From 99c21957dec6b74f954fde6434098afbe8034a07 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 13:04:58 +0100 Subject: [PATCH] Item 4 (join 11): the composition-inputs test guards what each machine was asked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gather asks the machines side by side, and the test's stand-in call wrote one map from each of them: a concurrent map write, the panic once seen at compositioninputs_test.go:61 (the race detector shows it every run). The record is guarded; the whole assigner's unit suite runs clean under the race detector. Builds: design 47 G §354, A-243, A-252 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- .../cmd/mesh-delivery-assigner/compositioninputs_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositioninputs_test.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositioninputs_test.go index 26fb32a1..fee01d44 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositioninputs_test.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/compositioninputs_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "strings" + "sync" "testing" "time" @@ -55,10 +56,14 @@ func TestTheMachinesOfAStep(t *testing.T) { // §354, A-243, A-252, §64: each machine is asked compose-candidate with the step's key and input true, its numbers as written; a // silent or unready node says why, and a machine away is not asked. func TestAStepsInputsAreAskedOfEachMachine(t *testing.T) { + // gather asks the machines side by side, so the record of what each was asked is guarded. + var mu sync.Mutex asked := map[string]string{} call := func(node, key string, body any) (json.RawMessage, error) { raw, _ := json.Marshal(body) + mu.Lock() asked[node] = key + " " + string(raw) + mu.Unlock() switch node { case "g14": return nil, errors.New("no responders")