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

Jest tests hanging forever with large snapshot changes #5392

Closed
digitalsadhu opened this issue Jan 25, 2018 · 10 comments
Closed

Jest tests hanging forever with large snapshot changes #5392

digitalsadhu opened this issue Jan 25, 2018 · 10 comments
Assignees

Comments

@digitalsadhu
Copy link

Jest tests hanging forever when there have been large snapshot changes. Running jest -u seems to fix the issue.

Reproduce by pulling down this branch and running jest. It should sit spinning forever. Run jest -u to fix. Subsequent calls to jest should work.

@SimenB
Copy link
Member

SimenB commented Jan 25, 2018

/cc @pedrottimark could you take a look at this? My guess is that the diff generation ends up in some sort of loop, preventing both the diff from being generated, and the test from timing out.

@pedrottimark
Copy link
Contributor

@SimenB @digitalsadhu Yes, this looks like same problem #1772 which I have been working on.

Very timely to have more offline stress tests. I will put received and expected serializations into separate files to measure heap used by improved diff-sequences versus baseline diff package.

@pedrottimark
Copy link
Contributor

@digitalsadhu Unrelated to the problem, is there a duplicated assertion in reader.test.js under the last test 'bundling dedupes common modules' what a delightful pun :)

https://github.com/asset-pipe/asset-pipe-js-reader/blob/jest_large_snapshots_run_forever/test/reader.test.js#L287-L290

@pedrottimark
Copy link
Contributor

And the winner is should concat 2 files snapshot diff on node 9.4.0:

package heap used elapsed time
diff-snapshot 12,088,376 0.040633
diff 169,757,848 295.061440

Unlike previous example from React, this example has similar number of expected and received lines and a smaller (almost a quarter though) proportion of changed lines:

category lines
expected 35,132
received 27,823
common 27,805
delete 7,318
insert 18

@SimenB
Copy link
Member

SimenB commented Jan 26, 2018

Thanks for digging in!

Are you saying this is a duplicate of #1772, and can be tracked there? Is there anything we can do currently to at least be able to time out the test? Or should we just wait until the underlying issue is fixed?

@digitalsadhu
Copy link
Author

@pedrottimark hah! right you are. Very punny. ;)

@pedrottimark
Copy link
Contributor

pedrottimark commented Jan 26, 2018

@SimenB We can let this shorter issue be primary and the earlier longer issue be secondary.

  1. I will open a pull request for new package today or tomorrow. Besser spät als nie :)
  2. As soon as that is reviewed and merged, I will convert jest-diff to [EDIT: call the] new package.
  3. And then, I can open a replacement for dormant pull request to diff substrings.

@sumanthns
Copy link

Hi @pedrottimark , We are also facing the same issue. Are there any updates? Did you get a chance to open a pull request?

@SimenB
Copy link
Member

SimenB commented Jan 11, 2019

#6961

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants