-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Version
20.9.0
Platform
Linux ua0683ea36b1857.ant.amazon.com 5.15.0-88-generic #98~20.04.1-Ubuntu SMP Mon Oct 9 16:43:45 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
test runner
What steps will reproduce the bug?
# run.mjs
import { run } from 'node:test';
import { tap } from 'node:test/reporters';
import process from 'node:process';
const signal = AbortSignal.timeout(10)
run({ files: ['test.mjs'], signal })
.compose(tap)
.pipe(process.stdout);
# test.mjs
import { test } from 'node:test'
import { setTimeout } from 'timers/promises'
test('a test', async () =>setTimeout(10_000))
node ./run.mjs
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
I would expect the run to timeout and error after 10ms, but instead it runs for 10 seconds.
What do you see instead?
The test runs for 10 seconds and completes successfully.
Additional information
I see the same behavior whether I use AbortSignal.timeout(10)
, AbortSignal.aborted()
, or ac= new AbortController(); setTimeout(() => ac.abort(), 10)
.
Setting timeout: 10
throws as I expected.
import { test } from 'node:test'
import { setTimeout } from 'timers/promises'
test('a test', async () => {
await setTimeout(10_000)
})
Metadata
Metadata
Assignees
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.