[CRCR] Treat expected non-success outcomes (xfail/xcancel/xtimeout) as successes in pass rate - #8376
Conversation
|
@subinz1 is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
Dependency: This PR depends on pytorch/crcr-test#19 being merged first — that PR introduces the |
|
HI @subinz1 I don't see any difference between currently deployed prod change and this one. Still showing 85% success and degraded state same as https://hud.pytorch.org/crcr/pytorch/crcr-test:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I wonder if we can set the conclusion of xfail/xcancel/xtimeout to something like |
|
Right problem to fix — 1. The name check isn't paired with a conclusion checkThe SQL counts a job as a pass if it's named This matters more than a normal counting bug: 2. Double counting
Suggested shapeDefine the predicate once, pairing each name with its expected conclusion, and apply it symmetrically. That makes the buckets mutually exclusive by construction and fixes both issues: -- is_expected
{repo: String} = 'pytorch/crcr-test' AND (
(job_name LIKE '%xfail%' AND conclusion = 'failure')
OR (job_name LIKE '%xcancel%' AND conclusion = 'cancelled')
OR (job_name LIKE '%xtimeout%' AND conclusion = 'timed_out')
)
successes = countIf(conclusion = 'success' OR is_expected)
failures = countIf(conclusion = 'failure' AND NOT is_expected)
timed_out = countIf(conclusion = 'timed_out' AND NOT is_expected)On normalizing at the source insteadThere's been discussion of having the
Longer term the cleanest version is probably an explicit Merge orderThis touches Minor, non-blocking: |
The previous version counted x-prefixed jobs as successes based on name alone, without checking the actual conclusion. This meant an xfail job that unexpectedly succeeded would still read as green, and an xtimeout job that failed would be double-counted in both successes and failures. Pair each x-prefix with its expected conclusion so the buckets are mutually exclusive: xfail must actually fail, xcancel must be cancelled, xtimeout must time out.
…query Same is_expected predicate fix applied to the daily success rate time series used by the CRCR metrics page.
Same is_expected predicate fix applied to the per-repo dashboard
summary query. Uses {repo: String} parameter consistently (matching
the WHERE clause) instead of hardcoding downstream_repo.
0475313 to
2e883c0
Compare
|
@atalman Great catch on both issues — the missing conclusion check and the double-counting are real bugs. I've reworked the queries to use the paired -- Expected probe outcomes: name must match its intended conclusion
is_expected = downstream_repo = 'pytorch/crcr-test' AND (
(job_name LIKE '%xfail%' AND conclusion = 'failure')
OR (job_name LIKE '%xcancel%' AND conclusion = 'cancelled')
OR (job_name LIKE '%xtimeout%' AND conclusion = 'timed_out')
)Applied symmetrically:
This fixes both issues:
Also noted the merge order concern with #8421 and #8425. Will rebase after those land. |

Summary
Fixes the CRCR pass rate calculation to correctly handle expected non-success outcomes in health-probe repos like
pytorch/crcr-test.The
crcr-testrepo uses jobs withx-prefixed names (xfail,xcancel,xtimeout) that intentionally end in failure, cancellation, or timeout to test the relay's handling of these outcomes (see pytorch/crcr-test#19). These expected results were being counted as failures in the ClickHouse pass rate queries, causingpytorch/crcr-testto show a degraded health status even though the relay is functioning correctly.Changes
Three ClickHouse queries updated with the same logic:
crcr_summary— CRCR summary page (/crcr)crcr_success_rate— CRCR metrics page (/crcr/metrics)crcr_backend_summary— per-repo dashboard (/crcr/[org]/[repo])For each query:
job_name LIKE '%xfail%','%xcancel%', or'%xtimeout%'xfailjobsxtimeoutjobsThis uses the
job_nameconvention established in pytorch/crcr-test#19 — jobs prefixed withxare intentional/expected outcomes, not bugs.Fixes #8306
Test plan
pytorch/crcr-testpytorch/crcr-testshows accurate stats