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.
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.
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.
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.
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.