From f4df4e4bf3cfb2a36080e830c4e271ab3633a8ec Mon Sep 17 00:00:00 2001 From: Gas City Adopt-PR Date: Thu, 1 Oct 2026 06:19:33 +0000 Subject: [PATCH] ci(bazel): never cache embedded-tier test results Review F2. Since D2 step 1 the Bazel embedded lane is the tier's only pre-merge run on same-repo PRs, so a cached PASS (stale, or a poisoned entry in the shared farm action cache) or a cached run that never re-exercises an intermittent -race finding would stand in for the legacy jobs' -test.count=1 run. test:embedded now sets --nocache_test_results, and the policy test requires it and forbids any other rc line that turns test result caching back on. Co-Authored-By: Claude Opus 5.5 (1M context) --- .bazelrc | 6 ++++++ scripts/ci_workflow_test.go | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/.bazelrc b/.bazelrc index 308ab55ec..b700f8961 100644 --- a/.bazelrc +++ b/.bazelrc @@ -99,6 +99,12 @@ test:embedded --test_timeout=-1,-1,-1,1200 test:embedded --test_arg=-test.parallel=4 test:embedded --test_env=GO_TEST_WRAP_TESTV=1 test:embedded --remote_download_regex=.*/test\.xml$ +# Since D2 step 1 this lane is the tier's only pre-merge run on same-repo PRs +# (pr-risk.yml's legacy jobs stand down), and the legacy jobs ran every test +# every time (-test.count=1). A cached PASS would let a stale or poisoned +# farm action-cache entry, or an unreproduced -race finding, stand in for a +# run: always execute, at farm (not runner) cost. +test:embedded --nocache_test_results # Dolt-server lane: the same jobs as the docker lane ("Test (storage domain + # uow)" and "Contract corpus"), but every dolt sql-server is a child of the diff --git a/scripts/ci_workflow_test.go b/scripts/ci_workflow_test.go index 2f2173d3d..66098f23d 100644 --- a/scripts/ci_workflow_test.go +++ b/scripts/ci_workflow_test.go @@ -3378,12 +3378,21 @@ func TestBazelEmbeddedJobMirrorsEmbeddedTier(t *testing.T) { "test:embedded --test_tag_filters=embedded", // The jobs pass no -parallel: GOMAXPROCS on 4-vCPU ubuntu-latest. "test:embedded --test_arg=-test.parallel=4", + // The tier's only pre-merge run (D2 step 1) must execute, like the + // legacy jobs' -test.count=1, never replay a cached result. + "test:embedded --nocache_test_results", } { if !rc[want] { t.Errorf(".bazelrc lacks %q", want) } } for line := range rc { + // Nothing turns result caching back on for the embedded lane (a + // later --cache_test_results wins over --nocache_test_results). + if !strings.HasPrefix(line, "#") && strings.Contains(line, "cache_test_results") && + line != "test:embedded --nocache_test_results" && line != "test:docker --nocache_test_results" { + t.Errorf(".bazelrc %q: only test:embedded and test:docker set test result caching", line) + } if strings.HasPrefix(line, "test:embedded ") && (strings.Contains(line, "-test.short") || strings.Contains(line, "BEADS_TEST_SKIP")) { t.Errorf(".bazelrc %q: the embedded jobs run without -short and BEADS_TEST_SKIP", line) }