Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test_runner: t.after is never called #51997

Copy link
Copy link
@KhafraDev

Description

@KhafraDev
Issue body actions

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?

Uzlopak and metcoder95

Metadata

Metadata

Assignees

No one assigned

    Labels

    test_runnerIssues and PRs related to the test runner subsystem.Issues 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.