-
-
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
fix(jest-worker): failed assertion with circular value hangs the test run #14675
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
703cfad
to
b06be16
Compare
Close/open for test re-run |
rerun tests again due to infra reliability (yarn install on mac) |
rerun again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, awesome to see some movement on this!
Can you also unskip this?
test.skip('handles circular inequality properly', async () => { |
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
export function withoutCircularRefs(obj: unknown): unknown { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do the inverse as well - rebuild the object with the circular references in place?
I.e. what https://www.npmjs.com/package/flatted does (I see they now wanna push users to https://github.com/ungap/structured-clone/blob/main/README.md#extra-features, might be worth a look)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimenB flatted
and structured-clone
have own serialization format, so both jest-runner and jest-worker should have the same serialize/parse logic. But currently runner and worker are different packages and end-users might have different versions on their installation.
So we break a transport layer by this improvement. Better to do it in another PR as improvement and R&D, this PR is a bug fix PR. And I'm very sorry but I don't have enough bandwidth to deal with bumping v30 😉
@SimenB friendly ping ;) |
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one. |
This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Relates #10577
Summary
When an assertion fails where either the expected or actual value is circular, and both values are objects, jest encounters an error stating it failed to convert a circular structure to JSON, resulting in the test run not completing.
This PR fixes sending
result
with circular references from worker to runner.