Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner (after) doesn't work on v21.7.0 #52013

Closed
timursevimli opened this issue Mar 8, 2024 · 1 comment
Closed

test_runner (after) doesn't work on v21.7.0 #52013

timursevimli opened this issue Mar 8, 2024 · 1 comment

Comments

@timursevimli
Copy link

Version

node v21.7.0

Platform

macOS Sonoma 14.3.1 Darwin Kernel Version 23.3.0

Subsystem

node:test

What steps will reproduce the bug?

In version 21.7.0, the t.after method is not called and completed, unlike other versions (I tried v21.6.2 and v20.11.0)

'use strict';

const assert = require('node:assert');
const test = require('node:test');

const someListener = () => {
  let timer = setTimeout(() => {}, 9999999);
  return {
    cancel: () =>  {
      if (!timer) return;
      clearTimeout(timer);
      timer = null;
    }
  };
};

test('This test, does not complete', async (t) => {
  const listener = someListener();

  t.after(() => {
    listener.cancel();
  });

  assert.strictEqual(1, 1);
});

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

No response

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

No response

What do you see instead?

What I see on v21.7.0
Screenshot 2024-03-08 at 2 41 18 PM

What I expected:
Screenshot 2024-03-08 at 2 41 44 PM

Additional information

No response

@climba03003
Copy link
Contributor

It is already fixed in #51998
And pending to release on #52002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants