Version
v21.7.0
Platform
n/a
Subsystem
test_runner
What steps will reproduce the bug?
import { once } from 'node:events'
import { createServer } from 'node:http'
import { test } from 'node:test'
test('after is called', async (t) => {
const server = createServer((req, res) => res.end())
.listen(0)
t.after(() => {
console.log('Called!')
server.close()
})
await once(server, 'listening')
await fetch(`http://localhost:${server.address().port}`)
})
node --test test.mjs
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
the test hangs, "Called!" is never printed to the console
Additional information
It could be caused by #51389?
Version
v21.7.0
Platform
n/a
Subsystem
test_runner
What steps will reproduce the bug?
node --test test.mjs
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
the test hangs, "Called!" is never printed to the console
Additional information
It could be caused by #51389?