-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
base: main
Are you sure you want to change the base?
lib: fix testNamePatterns and testSkipPatterns being ignored with isolation "none" #58496
Conversation
Review requested:
|
@@ -691,6 +691,17 @@ function run(options = kEmptyObject) { | |||
cwd, | |||
globalSetupPath, | |||
}; | |||
|
|||
if (isolation === 'none') { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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'",() => { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
)
9af076f
to
9aeef6c
Compare
Fixes #57399.