From d2549e05aa2bf264d96f699b9bacbc7f8d538c83 Mon Sep 17 00:00:00 2001 From: Tri Lam Date: Mon, 18 May 2026 23:46:01 -0700 Subject: [PATCH] [ci] selftelemetry: relax degraded-counter regex to accept any positive value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestReceiver_SetDegraded asserted the degraded_seconds_total counter matched `0\.0[0-9]+` — an upper-bounded shape requiring the value to fall in `[0.0, 0.1)`. The test's stated intent (per its comment "Value must be >0 (>= ~0.05s)") is just "counter advanced past zero", so the upper bound is brittle artifact, not load-bearing. Caught on PR #76's rerun, where a slow GH Actions runner observed 0.126s of degraded time — well past the regex's implicit 0.1s ceiling, but well within the test's actual intent. Same flake shape as the SLI deflake landed in PR #76: a CI-timing assertion calibrated to fast-runner expectations failing on a slow runner. Fix: regex becomes `\d+\.[0-9]*[1-9]` — match any value with at least one non-zero digit after the decimal point. Accepts 0.05, 0.126, 1.5, etc.; correctly rejects 0, 0.0, 0.000. Verified locally: 10 isolated runs PASS; 20 iterations under GOMAXPROCS=2 + full package PASS. Signed-off-by: Tri Lam --- internal/selftelemetry/impl_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/selftelemetry/impl_test.go b/internal/selftelemetry/impl_test.go index e9f652f2..f6b600f8 100644 --- a/internal/selftelemetry/impl_test.go +++ b/internal/selftelemetry/impl_test.go @@ -128,9 +128,14 @@ func TestReceiver_SetDegraded(t *testing.T) { body := scrape(t, url) require.Contains(t, body, "tracecore_receiver_degraded_seconds_total") - // Value must be >0 (>= ~0.05s). + // Value must be >0. The intent is "advanced past zero"; the + // fractional part must contain at least one non-zero digit. No + // upper bound — CI runners under contention can extend the + // observed window well past 50ms (a slow runner saw 0.126s on + // PR #76's rerun and failed against the prior `0\.0[0-9]+` + // upper-bound shape). require.Regexp(t, - `tracecore_receiver_degraded_seconds_total\{[^}]*component_id="clockreceiver/TestReceiver_SetDegraded"[^}]*\}\s+0\.0[0-9]+`, + `tracecore_receiver_degraded_seconds_total\{[^}]*component_id="clockreceiver/TestReceiver_SetDegraded"[^}]*\}\s+\d+\.[0-9]*[1-9]`, body, "degraded counter advanced past 0") recv.SetDegraded(false)