Skip to content

Commit

Permalink
[integration_test] Don't log exceptions twice (flutter#81812)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahaog committed May 8, 2021
1 parent 783e1dd commit 099f116
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ When the exception was thrown, this was the stack:
<<skip until matching line>>
The test description was:
Exception handling in test harness - string
<<skip until matching line>>
Test failed\. See exception logs above\.
════════════════════════════════════════════════════════════════════════════════════════════════════
\d\d:\d\d \+0 -1: Exception handling in test harness - string \[E\]
Test failed. See exception logs above.
The test description was: Exception handling in test harness - string
<<skip until matching line>>
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
Expand All @@ -20,9 +21,10 @@ When the exception was thrown, this was the stack:
#0 main.<anonymous closure> \(.+[/\\]dev[/\\]automated_tests[/\\]integration_test[/\\]exception_handling_test\.dart:13:5\)
<<skip until matching line>>
The test description was:
Exception handling in test harness - FlutterError
<<skip until matching line>>
Test failed\. See exception logs above\.
Exception handling in test harness - FlutterError
════════════════════════════════════════════════════════════════════════════════════════════════════
\d\d:\d\d \+0 -2: Exception handling in test harness - FlutterError \[E\]
Test failed. See exception logs above.
The test description was: Exception handling in test harness - FlutterError
<<skip until matching line>>
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
Expand All @@ -33,9 +35,11 @@ When the exception was thrown, this was the stack:
#2 main.<anonymous closure> \(.+[/\\]dev[/\\]automated_tests[/\\]integration_test[/\\]exception_handling_test\.dart:16:5\)
<<skip until matching line>>
The test description was:
Exception handling in test harness - uncaught Future error
<<skip until matching line>>
Test failed\. See exception logs above\.
Exception handling in test harness - uncaught Future error
════════════════════════════════════════════════════════════════════════════════════════════════════
\d\d:\d\d \+0 -3: Exception handling in test harness - uncaught Future error \[E\]
Test failed. See exception logs above.
The test description was: Exception handling in test harness - uncaught Future error
.*(TODO\(jiahaog\): Remove the next line once https://github.com/flutter/flutter/issues/81521 is fixed)?
<<skip until matching line>>
.*..:.. \+0 -3: Some tests failed\. *
15 changes: 15 additions & 0 deletions packages/integration_test/lib/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,19 @@ https://flutter.dev/docs/testing/integration-tests#testing-on-firebase-test-lab
// TODO(jiahaog): Remove when https://github.com/flutter/flutter/issues/66006 is fixed.
super.attachRootWidget(RepaintBoundary(child: rootWidget));
}

@override
void reportExceptionNoticed(FlutterErrorDetails exception) {
// This method is called to log errors as they happen, and they will also
// be eventually logged again at the end of the tests. The superclass
// behavior is specific to the "live" execution semantics of
// [LiveTestWidgetsFlutterBinding] so users don't have to wait until tests
// finish to see the stack traces.
//
// Disable this because Integration Tests follow the semantics of
// [AutomatedTestWidgetsFlutterBinding] that does not log the stack traces
// live, and avoids the doubly logged stack trace.
// TODO(jiahaog): Integration test binding should not inherit from
// `LiveTestWidgetsFlutterBinding` https://github.com/flutter/flutter/issues/81534
}
}

0 comments on commit 099f116

Please sign in to comment.