Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node:test hangs when BroadcastChannel is left open #52073

Closed
JakobJingleheimer opened this issue Mar 13, 2024 · 1 comment · Fixed by #52038
Closed

node:test hangs when BroadcastChannel is left open #52073

JakobJingleheimer opened this issue Mar 13, 2024 · 1 comment · Fixed by #52038
Labels
test_runner Issues and PRs related to the test runner subsystem.

Comments

@JakobJingleheimer
Copy link
Contributor

JakobJingleheimer commented Mar 13, 2024

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 the BroadcastChannel would not be manually closed (like it is in my "fixed" example above).

@JakobJingleheimer JakobJingleheimer added v21.x test Issues and PRs related to the tests. test_runner Issues and PRs related to the test runner subsystem. and removed test Issues and PRs related to the tests. labels Mar 13, 2024
@MoLow
Copy link
Member

MoLow commented Mar 13, 2024

@JakobJingleheimer this seems to duplicate #49925

@MoLow MoLow linked a pull request Mar 13, 2024 that will close this issue
@MoLow MoLow closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants