Skip to content

Commit 317e36d

Browse files
Jonah WilliamsInconnu08
authored andcommitted
Dont close debug connection on exit (flutter#42655)
1 parent 14d7de9 commit 317e36d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class ResidentWebRunner extends ResidentRunner {
108108
if (_exited) {
109109
return;
110110
}
111-
await _connectionResult?.debugConnection?.close();
112111
await _stdOutSub?.cancel();
113112
await _webFs?.stop();
114113
await device.stopApp(null);

packages/flutter_tools/test/general.shard/resident_web_runner_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,12 @@ void main() {
431431
test('cleanup of resources is safe to call multiple times', () => testbed.run(() async {
432432
_setupMocks();
433433
bool debugClosed = false;
434-
when(mockDebugConnection.close()).thenAnswer((Invocation invocation) async {
434+
when(mockWebDevice.stopApp(any)).thenAnswer((Invocation invocation) async {
435435
if (debugClosed) {
436436
throw StateError('debug connection closed twice');
437437
}
438438
debugClosed = true;
439+
return true;
439440
});
440441
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
441442
unawaited(residentWebRunner.run(
@@ -445,6 +446,8 @@ void main() {
445446

446447
await residentWebRunner.exit();
447448
await residentWebRunner.exit();
449+
450+
verifyNever(mockDebugConnection.close());
448451
}));
449452

450453
test('Prints target and device name on run', () => testbed.run(() async {

0 commit comments

Comments
 (0)