diff --git a/dev/automated_tests/integration_test/exception_handling_expectation.txt b/dev/automated_tests/integration_test/exception_handling_expectation.txt index 44c2e02810..b91f848c3d 100644 --- a/dev/automated_tests/integration_test/exception_handling_expectation.txt +++ b/dev/automated_tests/integration_test/exception_handling_expectation.txt @@ -8,8 +8,9 @@ When the exception was thrown, this was the stack: <> The test description was: Exception handling in test harness - string -<> - 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 <> ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ @@ -20,9 +21,10 @@ When the exception was thrown, this was the stack: #0 main. \(.+[/\\]dev[/\\]automated_tests[/\\]integration_test[/\\]exception_handling_test\.dart:13:5\) <> The test description was: -Exception handling in test harness - FlutterError -<> - 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 <> ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ @@ -33,9 +35,11 @@ When the exception was thrown, this was the stack: #2 main. \(.+[/\\]dev[/\\]automated_tests[/\\]integration_test[/\\]exception_handling_test\.dart:16:5\) <> The test description was: -Exception handling in test harness - uncaught Future error -<> - 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)? <> .*..:.. \+0 -3: Some tests failed\. * diff --git a/packages/integration_test/lib/integration_test.dart b/packages/integration_test/lib/integration_test.dart index 4f3f2bd61f..1e39d35d3d 100644 --- a/packages/integration_test/lib/integration_test.dart +++ b/packages/integration_test/lib/integration_test.dart @@ -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 + } }