Skip to content
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

[Bug]: workerThreads break --watch-all when function does not meet expected. #14423

Open
roffelund opened this issue Aug 17, 2023 · 4 comments
Open

Comments

@roffelund
Copy link

Version

29.6.2

Steps to reproduce

  1. Clone my repo at: https://github.com/roffelund/jest-function-expect-bug
  2. yarn
  3. yarn test test.test.js --watch-all

Expected behavior

Screenshot 2023-08-17 at 10 36 09

I expected the test to show that the expected and received do not match.

Actual behavior

Screenshot 2023-08-17 at 10 35 19

Test stops running with exception

Additional context

This only happens when running with workers. Turning off workers expected behaviour works fine.

Environment

System:
    OS: macOS 13.4
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 18.17.0 - /opt/homebrew/opt/node@18/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.6.7 - /opt/homebrew/opt/node@18/bin/npm
  npmPackages:
    jest: 29.6.2 => 29.6.2
@roffelund roffelund changed the title [Bug]: [Bug]: Workers throw error when testing functions. Aug 17, 2023
@roffelund roffelund changed the title [Bug]: Workers throw error when testing functions. [Bug]: Workers break --watch-all when function does not meet expected. Aug 17, 2023
@mrazauskas
Copy link
Contributor

Thanks for the reproduction! I saw this happening, but didn’t had time to figure out what was the exact cause. Huge objects were around, so it was difficult to reason about.

Seems like serialization fails somewhere in the threads worker, because all is smooth with workerThreads: false.

@mrazauskas
Copy link
Contributor

mrazauskas commented Aug 17, 2023

By the way, could you mention in the title that the issue is specifically related with workerThreads, not just workers in general.

@roffelund roffelund changed the title [Bug]: Workers break --watch-all when function does not meet expected. [Bug]: workerThreads break --watch-all when function does not meet expected. Aug 17, 2023
@roffelund
Copy link
Author

Thanks for the reproduction! I saw this happening, but didn’t had time to figure out what was the exact cause. Huge objects were around, so it was difficult to reason about.

Seems like serialization fails somewhere in the threads worker, because all is smooth with workerThreads: false.

Took some debugging to narrow it down. As you say workerThreads: false all is smooth sailing.

@dj-stormtrooper
Copy link
Contributor

Hey, I tried to fix this issue here, would appreciate any feedback/suggestions
#14436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants