Skip to content

ci(playwright): post merge-queue flaky tests to #pw-health - #34283

Merged
chirag-madlani merged 2 commits into
mainfrom
chirag-madlani/queue-flaky-alert
Sep 30, 2026
Merged

chirag-madlani merged 2 commits into
mainfrom
chirag-madlani/queue-flaky-alert

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #33087

Describe your changes

Follow-up to #32833 (flake week). Merge-queue runs posted only failures (to #ci-cleanup). A test that failed and then passed on its retry stayed a shard warning that nobody sees, so queue flakes never reached the flake-week fix list.

Queue flaky alert → #pw-health

  • Each shard's coverage step (from ci(playwright): flake week with Slack alerts, first-attempt measurement, merge-queue coverage gate (no reports), timing and flake baselines on ci/playwright-timing #32833) now emits one Retry pass in merge queue annotation holding all its retry passes, one per line. GitHub keeps only 10 warning annotations per step, so one per test could silently drop some.
  • On every merge-queue run (green or red), the summary job reads the current attempt's annotations and posts to #pw-health with the queued PRs and the total count, listing 15 and then "…and N more". It sits next to the daily main-run flakes.
  • It uploads no artifacts, so the queue keeps its no-reports design. It's inline jq/gh, like the failure alert, because queue runs never check out code in the summary job.
  • The summary job gains checks: read, which the annotations API needs.

Example:

🟡 Merge queue: 2 test(s) passed only on retry for #34196
• FLAKY `Features/B.spec.ts:5 › flaky two`
• FLAKY `Pages/A.spec.ts:10 › flaky one`
run

Also: skip "Restore yarn package cache" in the summary job on merge_group. #34237 added it without the queue guard; queue runs have no checkout or yarn install to use it. test_merge_groups_upload_no_reports fails on main because of it, and passes with this change.

Verification

  • Dry run of the build step with gh stubbed:
    • flaky tests on two shards, one of them duplicated → each listed once, sent to #pw-health, tagged with the PR
    • no retry passes → no message
  • Against real data: job ids match check-run ids, and annotations expose title/message.
  • End to end: 20 flaky tests (one with % in its name) produce 1 annotation, decode back to all 20, and give a message with the count, 15 listed and "…and 5 more".
  • pytest .github/scripts/tests: 252 passed. The 3 failures also fail on main.
  • actionlint: no new findings.

🤖 Generated with Claude Code

The queue only posted failures (to #ci-cleanup); a retry pass stayed a shard
warning nobody watches. On every queue run, read the shards' existing
"Retry pass in merge queue" annotations for the current attempt and post any
to #pw-health with the queued PRs, alongside the daily main-run flakes. No
artifacts: the queue keeps its no-reports design. Needs checks: read.

Also skip the summary job's yarn cache restore on merge_group (#34237 added
it without the queue guard; queue runs have no checkout or install to use it),
which test_merge_groups_upload_no_reports catches on main.

Fixes #33087

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@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 30, 2026
…he queue alert

GitHub keeps only 10 warning annotations per step, so a shard with more than 10
retry passes would silently drop some before the #pw-health alert read them.
Each shard now emits one "Retry pass in merge queue" annotation holding the
whole list (workflow-command escaped), and the job summary still lists them.
The alert reads each line as a test, states the total, and says "…and N more"
past 15.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Workflow changes add merge-queue Slack alerts and adjust shard annotation handling.

Merge-queue runs now post flaky tests to #pw-health with a consolidated annotation per shard that avoids GitHub's 10-annotation-per-step limit. Each shard's coverage step emits one Retry pass in merge queue annotation listing all retry passes, the summary job reads them and posts to the channel with the queued PRs and total count (showing 15 and "…and N more"), and the summary job gains checks: read permission and skips the yarn cache restore on merge_group. No issues found.

✅ 1 closed
✅ Edge Case: Annotation limits silently drop queue flakes beyond 10 per shard

📄 .github/workflows/playwright-postgresql-e2e.yml:245-250
The alert only sees flakes that show up as check-run annotations. GitHub keeps at most 10 warning annotations per step (and 50 per job), and anything past that is dropped without an error. The shard's Verify shard coverage step prints one ::warning title=Retry pass in merge queue:: per flaky test, so a shard with more than 10 retry passes loses the rest. Those flakes never reach #pw-health, which is exactly what this PR is trying to prevent. The message says nothing about the list being incomplete, even though it also cuts the list at 15. Fix: have the shard emit a single warning holding the whole newline- or comma-joined list (or write a count line), then split it in the summary step. Alternatively, add a total count to the Slack message so it's clear when entries are missing.

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 aa37aa0c790e0c82aba15f81919e0e7d1f060f99 in Playwright run 36694044866, attempt 1.

✅ 551 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) 32m 32s

⏱️ Max setup 5m 2s · max shard execution 16m 12s · max shard-job elapsed before upload 19m 19s · reporting 4s

🌐 241.45 requests/attempt · 2.23 app boots/UI scenario · 22.94% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 22.94% (convergence target: at most 15%).
  • Browser traffic was 241.45 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (1271 boots / 570 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 130 0 0 0 0 0
✅ Shard chromium-02 134 0 0 0 0 0
✅ Shard chromium-03 129 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 30, 2026
Merged via the queue into main with commit 71005dd Sep 30, 2026
110 of 112 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/queue-flaky-alert branch September 30, 2026 14:18

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

3 participants