Flutter_tools for web: report error messages with stacks on exit (#87386)

* Flutter_tools for web platform: report error messages with stacks on toolExit

Print error messages and stacks in verbose mode before calling
`throwToolExit` on communication errors to chrome and dwds.

This will help us disagnose CI flakes:

Helps: https://github.com/flutter/flutter/issues/84012
Closes: https://github.com/flutter/flutter/issues/87149

* Added tests

* Extend timeout for testing failure to connect to chrome

* Update rest of chrome tests to await until matching is finished
This commit is contained in:
Anna Gringauze
2021-08-03 10:51:35 -07:00
committed by GitHub
parent d1eff7f4e3
commit 44d9af80cb
5 changed files with 88 additions and 49 deletions

View File

@@ -124,6 +124,15 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
}
}
Future<void> expectReturnsNormallyLater(Future<dynamic> future) async {
try {
await future;
// Catch all exceptions to give a better test failure message.
} catch (e, trace) { // ignore: avoid_catches_without_on_clauses
fail('Expected to run with no exceptions, got $e\n$trace');
}
}
Matcher containsIgnoringWhitespace(String toSearch) {
return predicate(
(String source) {