Count only the controller's own consumers in the deaf look, not the check workers a builder holds (issues 1063, 1543) #412

Merged
mesh-tools merged 2 commits from fix/1063-deaf-counts-own-consumers into main 2026-10-20 23:46:01 +00:00
Showing only changes of commit 54d8d139ad - Show all commits
@@ -4,6 +4,7 @@ package main
import (
"context"
"sync"
"testing"
"git.novox.be/novox/mesh-sdk/go/catalogue"
@@ -11,12 +12,16 @@ import (
"github.com/novox/mesh-controller/internal/link"
)
// asksWithPaths records every build a merge asks for, as repository, path and ref.
// asksWithPaths records every build a merge asks for, as repository, path and ref. The merge window's goroutine and
// the test's own may ask at once, so the record is written under a lock (issue 1543).
func asksWithPaths(t *testing.T) *[][3]string {
t.Helper()
var asked [][3]string
var mu sync.Mutex
was := askABuild
askABuild = func(_ context.Context, source buildSource, path, ref string) (string, error) {
mu.Lock()
defer mu.Unlock()
asked = append(asked, [3]string{source.Repository, path, ref})
return "b-" + path, nil
}