Skip to content

[codex] Deflake visitorId e2e assertion#245

Draft
JuroUhlar wants to merge 1 commit into
mainfrom
codex/fix-visitorid-e2e-flake
Draft

[codex] Deflake visitorId e2e assertion#245
JuroUhlar wants to merge 1 commit into
mainfrom
codex/fix-visitorid-e2e-flake

Conversation

@JuroUhlar

@JuroUhlar JuroUhlar commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the fixed 5 second sleep in the visitorId Playwright test with a polling assertion
  • wait until each <code> result block contains parseable JSON with a valid visitorId/requestId pair
  • add runtime guards so partial or malformed intermediate content is treated as not-ready instead of failing immediately

Why

The e2e test was flaky because it read and parsed the result element once after a fixed delay. When the page had rendered the element but had not populated valid JSON yet, the test failed even though the result would appear shortly after.

@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 99.61% 256/257
🟢 Branches 99.08% 108/109
🟢 Functions 100% 55/55
🟢 Lines 99.6% 251/252

Test suite run success

273 tests passing in 94 suites.

Report generated by 🧪jest coverage report action from 9d9d383

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 99.61 99.08 100 99.6
🟢  src 100 100 100 100
🟢   config.ts 100 100 100 100
🟢   env.ts 100 100 100 100
🟢   handler.ts 100 100 100 100
🟢   index.ts 100 100 100 100
🟢  src/handlers 98.7 96.15 100 98.66
🟢   ...ApiRequest.ts 96.42 87.5 100 96.15 79
🟢   ...StatusPage.ts 100 100 100 100
🟢  src/utils 100 100 100 100
🟢   ...ionHeaders.ts 100 100 100 100
🟢   ...Monitoring.ts 100 100 100 100
🟢   cookie.ts 100 100 100 100
🟢   ...orResponse.ts 100 100 100 100
🟢   ...WithMaxAge.ts 100 100 100 100
🟢   ...AgeIfLower.ts 100 100 100 100
🟢   proxyEndpoint.ts 100 100 100 100
🟢   ...tpResponse.ts 100 100 100 100
🟢   routing.ts 100 100 100 100

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.

1 participant