The checker leaves a try's candidate to its try: judged by both, the engines were asked twice (issue 1921)

The candidate of a try's group (try-<digits>) is judged by the Tryer; the candidates
watch also took it as a pull request's check. It failed at 432df759 already.

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 22:22:57 +01:00
parent d1acd6b231
commit 198dcdbe85
2 changed files with 9 additions and 0 deletions
@@ -222,6 +222,9 @@ func (ch *Checker) Wait() { ch.wg.Wait() }
// Candidate takes one value of the indexer's candidates bucket in (the key is the group) and checks it if it is to be
// checked. A value that is not a candidate is said and left.
func (ch *Checker) Candidate(ctx context.Context, key string, value []byte) {
if meshcatalogclient.IsTryGroup(key) {
return // a try's candidate is judged by its try (Tryer), never as a pull request's check: judged twice, the engines were asked twice
}
ch.init()
c, err := meshcatalog.DecodeCandidatesByGroupValue(value)
if err != nil {
@@ -157,6 +157,12 @@ func TestACandidateNotYetCheckedGetsItsVerdictKeyCreatedOnceAndIsJudged(t *testi
if j.count() != 1 {
t.Errorf("judged %d times after the same candidate again, want once", j.count())
}
// The candidate of a whole try's group is the try's: the try judges it, never the checker as a pull request's check.
r.ch.Candidate(ctx, "try-1793913602402800439", candidateOf(t, "try-1793913602402800439", pullOf(repoA, 7, head1)))
r.ch.Wait()
if j.count() != 1 {
t.Errorf("a try's candidate was judged as a check: %d judgments, want one", j.count())
}
}
// racyKV lets another instance create the key just before this one's create.