Terminate flutter test when no longer needed in integration test. (#159117)

Towards https://github.com/flutter/flutter/issues/51421.

```sh
flutter_tools % dart test test/integration.shard/break_on_framework_exceptions_test.dart

02:38 +29: All tests passed!

54692 ttys003    0:00.02 /opt/homebrew/bin/zsh -il
```

Requires https://github.com/flutter/flutter/pull/159115 for the process
cleanup to work properly, but this is safe to land as-is, otherwise we
still accumulate `flutter` processes over and over as each test case
runs which is not WAI.
This commit is contained in:
Matan Lurey 2024-11-19 08:16:08 -08:00 committed by GitHub
parent c5379557b3
commit 8536b96ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,6 +33,7 @@ void main() {
final FlutterTestTestDriver flutter = FlutterTestTestDriver(tempDir);
try {
await _timeoutAfter(
message: 'Timed out launching `flutter test`',
work: () => flutter.test(withDebugger: true, pauseOnExceptions: true),
@ -50,6 +51,11 @@ void main() {
);
expect(breakLine, project.lineContaining(project.test, exceptionMessage));
} finally {
// Some of the tests will quit naturally, and others won't.
// By this point we don't need the tool anymore, so just force quit.
await flutter.quit();
}
}
testWithoutContext('breaks when AnimationController listener throws', () async {