Skip to content

node:test hangs when BroadcastChannel is left open #52073

Closed

Description

@JakobJingleheimer

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).

Activity

  1. added
    test
    test_runner
    and removed
    test
    on Mar 13, 2024
  2. MoLow commented on Mar 13, 2024

    @MoLow
    Member

    @JakobJingleheimer this seems to duplicate #49925

  3. linked a pull request that will close this issuetest_runner: support forced exit #52038on Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    test_runner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions