-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
toBe hangs for cyclic structures #7429
Comments
Just in case, can you confirm it's not your algo getting stuck in while loop or recursion? |
As explained in #1405, if synchronous code is taking over, then timeout doesn't kick in. You can try |
Yes it should not be, I am currently using Jest and it passes fine. I encountered the hanging issue while migrating to Vitest. I did further debugging and narrowed down the issue to this line I suspect the implementation of the |
Okay, that's likely a bug of printing/diffing a cyclic object getting stuck in the loop. |
Thanks. As a workaround I've changed my code to Updated StackBlitz repro to the minimal test case: https://stackblitz.com/edit/vitejs-vite-jtzpyjuo?file=src%2Fgraph.test.ts |
Describe the bug
Not much to say here, Vitest just doesn't complete when I have a certain test case for an algo question, it hangs indefinitely.
No async operations involved.
I don't think it's a bug with my algo because I'm migrating from Jest which is able to successfully run all the test cases.
With Vite it doesn't complete:
Reproduction
https://stackblitz.com/edit/vitejs-vite-jtzpyjuo
This is a minimal repro with 8 test cases (
tests.json
). My original code has 100 test cases (tests.all.json
).If the last test case in
tests.json
is removed (L240-L384), the tests can complete.System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: