node:test
hangs when BroadcastChannel
is left open
#52073
Labels
test_runner
Issues and PRs related to the test runner subsystem.
Version
21.7.1
Platform
Darwin Kernel Version 22.6.0, arm64
Subsystem
test
What steps will reproduce the bug?
$ node --test
Minimal repro: JakobJingleheimer/node-test-broadcastchannel@84b3de2
Minimal repro "fixed": JakobJingleheimer/node-test-broadcastchannel@9997b1e
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
node:test
should kill the open broadcast channel when the tests finish (this is what every other test runner I know of does, ex vitest).What do you see instead?
The command hangs indefinitely.
Additional information
This is especially relevant for tests of code that will run in a browser environment, where something like
process.on('exit')
doesn't exist, and theBroadcastChannel
would not be manually closed (like it is in my "fixed" example above).The text was updated successfully, but these errors were encountered: