-
Notifications
You must be signed in to change notification settings - Fork 202
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
Regression: v2.5.0 hangs in WSL #98
Comments
It looks like this may already be fixed in Windows insider builds: microsoft/WSL#1774 (comment). Which means it should hit the next big update due in October. |
I will close this issue then since it will be fixed from Microsoft’s end. |
I reverted to 2.4.3 and found I'm getting a similar issue when trying to write the diff file, which makes sense because it also uses The weird part is that this was working before, so I don't know what's going on. |
Something must have changed on WSLs end? Otherwise I’m not sure why the same code would work before but doesn’t now. I’d test myself but I don’t have any Windows machines readily available to me. |
Just confirming that everything seems to work fine in 2.5.0 after the new Windows update (just released). |
In WSL with 2.5.0,
.toMatchImageSnapshot()
hangs indefinitely. It worked in 2.4.3.I did some debugging and it seems to be related to the change in #95 to spawn a worker process. The main process hangs at the call to
spawnSync()
here:jest-image-snapshot/src/diff-snapshot.js
Lines 202 to 205 in a80a69c
Debugging the child process, I found the promise created by
getStdin.buffer()
never resolves:jest-image-snapshot/src/diff-process.js
Line 21 in a80a69c
Why doesn't the promise resolve? The
get-stdin
module is waiting on theend
event on the stdin stream which never fires: https://github.com/sindresorhus/get-stdin/blob/496456754b3cf8faabd320181374ef0bdb664820/index.js#L48-L50 (it's worth noting that thereadable
handler above it does fire and the data does get through).After a little more research it seems that
spawnSync()
and co. should close the stream, but this doesn't happen in WSL, which causes the process to hang. Other platforms presumably don't have this issue (at least Windows itself didn't when I tested it). Since this appears to be a WSL problem, I don't know if a workaround here is desirable or not, but this issue can serve as reference/tracking at the very least.The text was updated successfully, but these errors were encountered: