Skip to content

Commit

Permalink
Let the IsolateChannel close the ReceivePort (#2196)
Browse files Browse the repository at this point in the history
The `IsolateChannel` should close the receive port when we call
`outerChannel.sink.close` which is also added to the `cleanupCallbacks`.

This was originally added in #1280 to try to fix cases where the test
runner could hang after running some tests specifically on the test
runner CI when running the test as a subprocess. It looks like when
it was introduced there was no call to `outerChannel.sink.close()`.
A cleanup callback to close the sink was added in #1941 which made
this unnecessary.
  • Loading branch information
natebosch committed Mar 7, 2024
1 parent 7724aab commit ba64bbb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkgs/test_core/lib/src/runner/vm/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ class VMPlatform extends PlatformPlugin {
rethrow;
}
outerChannel = MultiChannel(IsolateChannel.connectReceive(receivePort));
cleanupCallbacks
..add(receivePort.close)
..add(isolate.kill);
cleanupCallbacks.add(isolate.kill);
}
cleanupCallbacks.add(outerChannel.sink.close);

Expand Down

0 comments on commit ba64bbb

Please sign in to comment.