-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Tests hang on Windows if run with PIPE stdin #3176
Comments
Looks like it's caused by accessing
https://github.com/rvagg/node-worker-farm/blob/v1.3.1/lib/fork.js |
Another workaround could be to replace this line global.process = Object.assign({}, process, toStringOverwrite); from https://github.com/facebook/jest/blob/v19.0.2/packages/jest-util/src/installCommonGlobals.js#L42 global.process = new Proxy(process, {
get: function(target, name) {
if (toStringOverwrite.hasOwnProperty(name)) {
return toStringOverwrite[name];
}
return target[name];
}
}); |
@wtgtybhertgeghgtwtg can you weigh in? |
Not to pass the buck, but isn't this a |
Thanks for looking into it! Even if it's a Node.js issue, applying a workaround on jest side could be beneficial for jest users. |
Apologies if I'm misunderstanding, but I don't see how the first workaround can be used without pulling |
@wtgtybhertgeghgtwtg You're correct. Either As for the second workaround, indeed, it won't work with node < 6. Anyway, global.process = new Proxy({}, {
get: function(target, name) {
if (toStringOverwrite.hasOwnProperty(name)) {
return toStringOverwrite[name];
}
return process[name];
}
}); |
We don't have Windows machines here at the moment, if you'd like to see this fixed, please send a PR with a test and we'll merge it. Thank you! From our side, this is not actionable, so I'm closing this issue. |
Shouldn't this be labeled with "Help Wanted" and not closed? |
@mdekrey can help to test it on v21 and |
That looks like it did it, at least for me @thymikee! Thanks! For anyone else who comes across this, |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When jest tests are run on Windows not in band and with redirected streams, the tests may hang indefinitely until force stopped.
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn install
andyarn test
.Setup a test set eligible for parallel running: unspecified
maxWorkers
, test count > 1, tests run > 3000 ms (e.g. https://repl.it/G4F4/2).Since test hanging is reproduced with redirected streams only and it's reproduced from time to time, there is a simple
stress-testing.js
script running jest tests endlessly:What is the expected behavior?
Tests don't hang.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
jest 19.0.2
node 7.7.3
npm 4.4.1
OS Windows 10, 64-bit
The text was updated successfully, but these errors were encountered: