diff --git a/packages/flutter_tools/test/integration/flutter_attach_test.dart b/packages/flutter_tools/test/integration/flutter_attach_test.dart index 28d208d144..ecee379ee7 100644 --- a/packages/flutter_tools/test/integration/flutter_attach_test.dart +++ b/packages/flutter_tools/test/integration/flutter_attach_test.dart @@ -24,8 +24,11 @@ void main() { }); tearDown(() async { + // We can't call stop() on both of these because they'll both try to stop the + // same app. Just quit the attach process and then send a stop to the original + // process. + await _flutterAttach.quit(); await _flutterRun.stop(); - await _flutterAttach.stop(); tryToDelete(tempDir); }); diff --git a/packages/flutter_tools/test/integration/test_driver.dart b/packages/flutter_tools/test/integration/test_driver.dart index 8eb1f068c9..e67fe89229 100644 --- a/packages/flutter_tools/test/integration/test_driver.dart +++ b/packages/flutter_tools/test/integration/test_driver.dart @@ -179,6 +179,8 @@ class FlutterTestDriver { return _proc.exitCode.timeout(quitTimeout, onTimeout: _killGracefully); } + Future quit() => _killGracefully(); + Future _killGracefully() async { if (_procPid == null) return -1;