From ad26670996d4f981eddf1afd3be4213121102d45 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 23 Oct 2026 17:18:37 +0200 Subject: [PATCH] Prove that a second check of the same heads keeps every package the first passed, the digest being taken inside the check ask as the build module answers it (issue 1917) --- .../internal/check/examiner_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/mesh-delivery-checker/internal/check/examiner_test.go b/modules/mesh-delivery-checker/internal/check/examiner_test.go index 53b5f75..c8c4e17 100644 --- a/modules/mesh-delivery-checker/internal/check/examiner_test.go +++ b/modules/mesh-delivery-checker/internal/check/examiner_test.go @@ -824,3 +824,22 @@ func TestACheckAskWaitingInItsStreamIsNotBounded(t *testing.T) { t.Fatalf("verdict %+v after %d asks, want a pass from the one ask", out.Verdict, len(b.asks.Asks())) } } + +// 1917: the digest is taken inside the check ask, as the build module's own digest step answers it (no step key is asked +// of it), so a second check of the same heads keeps every package the first one passed: "N kept", nothing run again. +func TestASecondCheckOfTheSameHeadsKeepsWhatTheFirstPassed(t *testing.T) { + b := newBench(t) + first := b.judge(t, caseOf(t, pullOf(repoA, 7, head1))).Verdict + u := first.Levels[delivery.LevelUnit] + if first.State != delivery.VerdictPass || u.Run == 0 || u.Kept != 0 { + t.Fatalf("the first check = %+v", first) + } + b.steps.calls = nil + second := b.judge(t, caseOf(t, pullOf(repoA, 7, head1))).Verdict + if s := second.Levels[delivery.LevelUnit]; second.State != delivery.VerdictPass || s.Kept != u.Run || s.Run != 0 { + t.Fatalf("the second check's unit level = %+v, want %d kept and none run", s, u.Run) + } + if n := len(b.steps.tool("test")); n != 0 { + t.Errorf("%d test steps ran on the second check", n) + } +}