fix: add handshake timeout to iframe communication#10656
Merged
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
sheremet-va
marked this pull request as ready for review
June 24, 2026 11:33
hi-ogawa
reviewed
Jun 25, 2026
| }, | ||
| ) | ||
|
|
||
| expect(stderr).toContain('did not become ready within 2000ms') |
Collaborator
There was a problem hiding this comment.
Stderr looks narrow to show in which layer the error is handled. Can you add error tree so it's easy to tell if this becomes file entity error or unhandled error?
Collaborator
There was a problem hiding this comment.
The new assertion didn't clarified for me much. I just dumped locally to get the idea.
Error tree will include __unhandled_errors__ but doesn't show cause so direct stderr assertion seems fine.
Case 2 — "fails instead of hanging when the tester never becomes ready"
⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯
Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯
Error: Failed to run the test /Users/hogawa/code/others/vitest-pr-10656/test/browser/vitest-test-11c97409-1b0f-4d9c-aa16-a9d7ff519bda/basic.test.ts.
❯ ../../../packages/vitest/dist/chunks/cli-api.CIsh518E.js:4957:17
❯ processTicksAndRejections ../node:internal/process/task_queues:104:5
Caused by: Error: The iframe "/Users/hogawa/code/others/vitest-pr-10656/test/browser/vitest-test-11c97409-1b0f-4d9c-aa16-a9d7ff519bda/basic.test.ts" did not become ready within 2000ms. The tester likely failed to initialize, check the browser console for errors.
❯ ../../../../../../../../__vitest_browser__/orchestrator-pKob2Z-i.js:188:28
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Case 3 — "fails instead of hanging when the tester stops responding to messages"
⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯
Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯
Error: Failed to run the test /Users/hogawa/code/others/vitest-pr-10656/test/browser/vitest-test-c6ba9b4e-3d1d-431a-86af-96d692eb11f2/basic.test.ts.
❯ ../../../packages/vitest/dist/chunks/cli-api.CIsh518E.js:4957:17
❯ processTicksAndRejections ../node:internal/process/task_queues:104:5
Caused by: Error: The iframe "/Users/hogawa/code/others/vitest-pr-10656/test/browser/vitest-test-c6ba9b4e-3d1d-431a-86af-96d692eb11f2/basic.test.ts" did not acknowledge the "prepare" message within 2000ms. The tester might have crashed, been removed, or be blocked by a long synchronous task.
❯ ../../../../../../../../__vitest_browser__/orchestrator-pKob2Z-i.js:332:28
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
hi-ogawa
requested changes
Jun 25, 2026
hi-ogawa
left a comment
Collaborator
There was a problem hiding this comment.
looks good to me except one test nit.
hi-ogawa
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a handshake timeout to catch iframes that were not setup properly. This should help catch bugs - normally, the timeout is not required.