Skip to content

fix(ci): keep earlier green shards on Playwright re-run; tolerate route-already-handled race - #34078

Merged
chirag-madlani merged 1 commit into
mainfrom
chirag-madlani/playwright-rerun-summary-and-route-race
Sep 27, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
chirag-madlani/playwright-rerun-summary-and-route-race

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

Fixes #33087

Describe your changes

Two CI fixes found while getting #33932 green.

1. playwright-summary fails every "Re-run failed jobs" attempt

The summary downloads only playwright-results-json-*-a${{ github.run_attempt }}*. A failed-jobs re-run only re-uploads the shards it re-ran, so on attempt 2 the summary saw one shard and counted the rest as missing. In run 36268674020 attempt 2 the re-run shard passed, but the gate reported 0 Playwright test failure(s); 68 CI/reporting failure(s). The one downloaded artifact was also flattened into results/, so not even that shard was found.

  • Download every attempt (playwright-results-json-*).
  • New step keep_latest_playwright_attempt.py deletes each shard's superseded attempts. This keeps the protection the attempt filter was added for (run 35650435023: a stale attempt-1 ci-status.json outranking a green re-run), because the classifier doesn't dedupe by attempt.
  • With more than one artifact downloaded, download-artifact keeps the per-artifact subfolders again.

2. serverLoad.ts asset cache: route.fulfill: Route is already handled!

This is the same page-teardown race ignoreClosedTarget already ignores for "has been closed" and "Response has been disposed". It failed ExploreBrowse.spec.ts "every result-card breadcrumb links to its hierarchy destination" on #33932 (job 108482457444), on both the first attempt and the retry. Added the message to the ignored list.

Tests

  • .github/scripts/tests/test_keep_latest_playwright_attempt.py: newest attempt kept per shard, -retry pair kept, legacy unsuffixed dirs superseded, non-results dirs untouched, missing dir is a no-op.
  • pytest .github/scripts/tests: 212 passed. The 2 failures (test_unavailable_first_attempt_evidence_never_becomes_a_pass[False], test_basic_project_excludes_dedicated_state_specs) also fail on current main.

Type of change

  • Bug fix

🤖 Generated with Claude Code

…handled teardown race

- playwright-summary downloaded only the current attempt's results, so a
  "Re-run failed jobs" attempt saw just the re-run shard and gated on 67+
  missing shards (run 36268674020 attempt 2: 0 tests, 68 CI/reporting
  failures). Download every attempt and prune each shard to its newest one,
  which still keeps a stale earlier ci-status.json out (run 35650435023).
- serverLoad asset cache: "Route is already handled!" is the same
  page-teardown race ignoreClosedTarget already swallows for closed/disposed
  targets; it failed ExploreBrowse on #33932.

Fixes #33087

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 27, 2026
@gitar-bot

gitar-bot Bot commented Sep 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · CI shard artifact selection and Playwright teardown error handling change.

Fixes two CI issues in Playwright test orchestration: downloads all attempt artifacts instead of only the latest to prevent summary failures on re-runs, and tolerates the "route already handled" race condition in asset cache teardown. Changes include a new keep_latest_playwright_attempt.py script to deduplicate shards across attempts and an added exception message to the ignored teardown errors. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 8475599e1717e020c239502bd0676819a38adc64 in Playwright run 36298567773, attempt 1.

✅ 564 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 50m 42s

⏱️ Max setup 4m 56s · max shard execution 15m 1s · max shard-job elapsed before upload 18m 29s · reporting 4s

🌐 193.90 requests/attempt · 2.22 app boots/UI scenario · 26.30% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 26.3% (convergence target: at most 15%).
  • Application boot ratio was 2.22 per UI scenario (1298 boots / 585 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 139 0 0 0 0 0
✅ Shard chromium-02 145 0 0 0 0 0
✅ Shard chromium-03 122 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@chirag-madlani
chirag-madlani added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit f9f22ff Sep 27, 2026
104 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/playwright-rerun-summary-and-route-race branch September 27, 2026 08:33

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge queue: recover transient artifacts and stabilize recurring E2E failures

2 participants