From c072a271e583cf9dc55c0a3ea73af3c6544783b0 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 9 Nov 2026 23:17:05 +0100 Subject: [PATCH] =?UTF-8?q?D4b:=20a=20row=20that=20a=20candidate=20taken?= =?UTF-8?q?=20out=20ends=20its=20check=20with=20a=20named=20cause,=20so=20?= =?UTF-8?q?the=20asker=20drops=20its=20asks=20(ADR=200664=20=C2=A75,=20iss?= =?UTF-8?q?ue=201748)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../internal/check/checker_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/mesh-delivery-checker/internal/check/checker_test.go b/modules/mesh-delivery-checker/internal/check/checker_test.go index e644894b..e33901e1 100644 --- a/modules/mesh-delivery-checker/internal/check/checker_test.go +++ b/modules/mesh-delivery-checker/internal/check/checker_test.go @@ -3,6 +3,7 @@ package check import ( "context" "encoding/json" + "errors" "fmt" "strings" "sync" @@ -362,6 +363,20 @@ func TestARepositoryWithNoTrunkCannotBeJudgedLoudlyUntilItsTrunkIsKnown(t *testi } }) } + + // ADR 0664 ยง5 (issue 1748): a candidate taken out (its pull request merged or closed) ends the check running for it with a + // cause its asks' wait names, never a plain cancel, so its asker drops the asks it put on the build nodes. + t.Run("a candidate taken out ends its check with a named cause", func(t *testing.T) { + ch := &Checker{} + ch.init() + run, end := context.WithCancelCause(context.Background()) + ch.live["g.heads"] = liveCheck{group: "g", end: end} + ch.Forget("g") + var s superseded + if cause := context.Cause(run); !errors.As(cause, &s) || s.by != "" || errors.Is(cause, context.Canceled) { + t.Errorf("the check was ended with %v, want superseded with no heads, not a plain cancel", cause) + } + }) } func countWith(lines []string, words string) int {