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")