fix(e2e): register upstream-block listeners before selectOption to avoid race condition - #9640
Merged
Merged
Conversation
…n to capture early failures Co-authored-by: ardatan <20847995+ardatan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code as per review comment 3813837700
fix(e2e): register upstream-block listeners before selectOption to avoid race condition
Aug 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces flakiness in the ExamplesSandbox Playwright e2e test by registering the “blocked” detection listeners (403 upstream response and X-Frame-Options console error) before triggering the example selection, preventing missed early failures that could otherwise lead to timeouts.
Changes:
- Moves
upstreamBlockPromiseandxFrameOptionsPromisesetup to occur beforeexampleSelect.selectOption(...)and the iframe-title visibility wait. - Gates both listeners behind
process.env.AGAINST_PROD === '1', resolving to'blocked-timeout'otherwise so non-prod runs keep existing behavior. - Keeps prod-specific verification logic (waiting for CodeSandbox content / outage banners / blocked signals) unchanged aside from the listener timing.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Apollo Federation Subgraph Compatibility Results
Learn more: |
Contributor
💻 Website PreviewThe latest changes are available as preview in: https://pr-9640.graphql-mesh-ai3.pages.dev |
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.
upstreamBlockPromiseandxFrameOptionsPromisewere set up afterselectOption()and the iframe title visibility wait. SinceExamplesSandboxsends apostMessageand updates the iframe title synchronously on change, a 403 response or X-Frame-Options console error could fire before the listeners were attached — causing the test to miss the "blocked" signal and eventually time out.Changes
website/src/components/examples-sandbox.e2e.tsupstreamBlockPromiseandxFrameOptionsPromiseregistration to beforeexampleSelect.selectOption(...)and the iframe titletoBeVisiblewait.process.env.AGAINST_PROD === '1'ternaries (resolving to'blocked-timeout'otherwise) so non-prod runs are unaffected.