fix(jest-worker): failed assertion with circular value hangs the test run#14675
fix(jest-worker): failed assertion with circular value hangs the test run#14675nodkz wants to merge 8 commits into
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 |
SimenB
left a comment
There was a problem hiding this comment.
thanks, awesome to see some movement on this!
Can you also unskip this?
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| export function withoutCircularRefs(obj: unknown): unknown { |
There was a problem hiding this comment.
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.
@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
resultwith circular references from worker to runner.