Skip to content

Fix red CI: example 7 hangs on production Turnstile - #333

Merged
mxschmitt merged 1 commit into
mainfrom
cursor/fix-example-7-turnstile-e2e-e4a3
Sep 4, 2026
Merged

Fix red CI: example 7 hangs on production Turnstile#333
mxschmitt merged 1 commit into
mainfrom
cursor/fix-example-7-turnstile-e2e-e4a3

Conversation

@mxschmitt

Copy link
Copy Markdown
Owner

Problem

main CI (CI / e2e test job) has been red since production Turnstile + live-run changes landed. Latest failure: https://github.com/mxschmitt/try-playwright/actions/runs/33842555644

Consistently failing:

  • Examples › 7: should be able to intercept and modify network requests on Chromium, WebKit, and Firefox (3 retries, 2 minutes each)
  • Occasional Firefox flake on should handle the timeout correctly (70s wait vs 60s worker timeout)

Example 7 navigates to live https://try.playwright.tech, intercepts POST /service/control/run, clicks Run, and waits for a placeholder image. After Turnstile shipped, automated browsers get Cloudflare error 600010. getToken() returns empty, Run throws Could not complete bot check. Please try again., the intercept never fires, and the e2e helper keeps waiting for Duration of … / Execution timeout! until the 120s test timeout.

Reproduced locally against production with the example's Playwright snippet; right panel showed Error: Could not complete bot check. Please try again. and /run was never requested.

Fix

  • In intercept-modify-requests.js, set window.__TRY_PLAYWRIGHT_TURNSTILE__ = 'noop' via context.addInitScript (same override the playground already honors) so the demo can intercept /run.
  • Tighten the mock /run payload (success, fileName) and match placehold.co responses more reliably.
  • Give the execution-timeout e2e assertion 90s so Firefox is less likely to lose the race.

Verified the updated snippet against production: /run is intercepted and the placeholder image loads in ~1s.

Example 7 intercept succeeding after Turnstile noop

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

The modifying-network-requests example drives live try.playwright.tech.
After Turnstile shipped, automated browsers get error 600010, Run never
POSTs /service/control/run, and CI waited two minutes for a duration
banner that never appeared.

Skip the bot check via the existing __TRY_PLAYWRIGHT_TURNSTILE__ flag,
and give the execution-timeout assertion more slack on Firefox.

Co-authored-by: Max Schmitt <max@schmitt.mx>
@mxschmitt
mxschmitt marked this pull request as ready for review September 4, 2026 15:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T16:00:44.546899Z d871c94 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mxschmitt
mxschmitt merged commit e96d960 into main Sep 4, 2026
12 checks passed
@mxschmitt
mxschmitt deleted the cursor/fix-example-7-turnstile-e2e-e4a3 branch September 4, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants