Skip to content

lib: fix testNamePatterns and testSkipPatterns being ignored with isolation "none" #58496

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielmbrasil
Copy link
Contributor

Fixes #57399.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels May 28, 2025
@@ -691,6 +691,17 @@ function run(options = kEmptyObject) {
cwd,
globalSetupPath,
};

if (isolation === 'none') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's a good approach. See my comment on the issue: #57399 (comment).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be a good starting point, but I agree that at first glance, this solution feels "out of place".

I'll take a look as soon as I can and come back with better feedback 🚀

@@ -648,6 +648,48 @@ describe('require(\'node:test\').run', { concurrency: true }, () => {
});
});

describe("with isolation set to 'none'",() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each of these tests passes individually, but when the whole describe block is run, the second test hangs indefinitely. I think it has something to do with how tests without isolation work, but I haven't found a fix yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it has something to do with how tests without isolation work

As you said, the problem is that the runner is running in the same process as the test file.
This is why you're encountering this issue.

You could follow the same logic used here: https://github.com/nodejs/node/blob/main/test/parallel/test-runner-run-watch.mjs

(Basically, by spawning a process that then calls run with isolation: none)

@danielmbrasil danielmbrasil force-pushed the fix/test-runner-ignore-patterns-isolation-none branch from 9af076f to 9aeef6c Compare May 28, 2025 14:37
@geeksilva97 geeksilva97 requested review from cjihrig and pmarchini May 28, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test runner run() ignores testNamePatterns and testSkipPatterns when isolation is "none"
3 participants