-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
detectOpenHandles imply runInBand #8283
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
detectOpenHandles imply runInBand #8283
Conversation
| {detectOpenHandles, maxWorkers, watch, watchAll}: Config.GlobalConfig, | ||
| ) { | ||
| /** | ||
| // detectOpenHandles makes no sense without runInBand, because it cannot detect leaks in workers |
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.
because it cannot detect leaks in workers
Is this a limitation of async_hooks API?
Anyway, since detectOpenHandles flag is handled before initializing TestScheduler, how about moving this logic there and adding a proper error message so users are aware? We need to alarm users about that anyway.
I'm good passing whole config to shouldRunInBand 👍
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.
Is this a limitation of
async_hooksAPI?
I mean, you could certainly make leak detection work in each worker, but I don't think it's worth it - a detectOpenHandles debug run doesn't need performance through parallelization.
adding a proper error message so users are aware? We need to alarm users about that anyway.
Not sure I understand correctly, do you want to error if detectOpenHandles without runInBand is used instead of just activating runInBand implicitly? I think forcing users to specify both would be quite annoying. Printing "did not exit within 1 second, please use --detectOpenHandles --runInBand" also doesn't look good :/
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.
On the second thought, we can hide it from the user. Would be nice to add a description note that adding this flag will make tests running serially
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.
Added to docs & yargs 👍
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
detectOpenHandlesmakes no sense withoutrunInBand, because it cannot detect leaks in workers.I've also changed
shouldRunInBandto just accept the config object, otherwise it would have lots of params.Test plan
Added one
test.eachline. Also tested manually.