Skip to content

testrunner: run() ignores timeout option #58802

Description

@ILikeRubberDuckies

Version

24.1.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

What steps will reproduce the bug?

runner.js

import { run } from "node:test";
import { spec } from "node:test/reporters";

run({
    timeout: 1000
}).compose(spec)
    .pipe(process.stdout);

tee.test.js

import { test } from "node:test";

test("tee", async () => {
    console.log("tee");
    await new Promise(() => { });
})

Run node runner.js -> Program never exits

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Test should run into timeout. Works as expected with --test-timeout flag.

What do you see instead?

Timeout probably remains infinity and program never exits.

Additional information

Activity

  1. pmarchini commented on Jun 23, 2025

    @pmarchini
    Member

    Cc @nodejs/test_runner

    Cc @jakecastelli

  2. jakecastelli commented on Jun 23, 2025

    @jakecastelli
    Member

    Thanks for the report! I think I know where the issue is, will try to put up a PR tomorrow.

  3. self-assigned this
    on Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

test_runnerIssues and PRs related to the test runner subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions