Unverified Commit f8a5baf3 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Dont close debug connection on exit (#42655)

parent 0dce0c6e
...@@ -108,7 +108,6 @@ class ResidentWebRunner extends ResidentRunner { ...@@ -108,7 +108,6 @@ class ResidentWebRunner extends ResidentRunner {
if (_exited) { if (_exited) {
return; return;
} }
await _connectionResult?.debugConnection?.close();
await _stdOutSub?.cancel(); await _stdOutSub?.cancel();
await _webFs?.stop(); await _webFs?.stop();
await device.stopApp(null); await device.stopApp(null);
......
...@@ -431,11 +431,12 @@ void main() { ...@@ -431,11 +431,12 @@ void main() {
test('cleanup of resources is safe to call multiple times', () => testbed.run(() async { test('cleanup of resources is safe to call multiple times', () => testbed.run(() async {
_setupMocks(); _setupMocks();
bool debugClosed = false; bool debugClosed = false;
when(mockDebugConnection.close()).thenAnswer((Invocation invocation) async { when(mockWebDevice.stopApp(any)).thenAnswer((Invocation invocation) async {
if (debugClosed) { if (debugClosed) {
throw StateError('debug connection closed twice'); throw StateError('debug connection closed twice');
} }
debugClosed = true; debugClosed = true;
return true;
}); });
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>(); final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
unawaited(residentWebRunner.run( unawaited(residentWebRunner.run(
...@@ -445,6 +446,8 @@ void main() { ...@@ -445,6 +446,8 @@ void main() {
await residentWebRunner.exit(); await residentWebRunner.exit();
await residentWebRunner.exit(); await residentWebRunner.exit();
verifyNever(mockDebugConnection.close());
})); }));
test('Prints target and device name on run', () => testbed.run(() async { test('Prints target and device name on run', () => testbed.run(() async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment