Item 4 (join 11): the composition-inputs test guards what each machine was asked

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
This commit is contained in:
2026-11-12 13:04:58 +01:00
parent 778bcd0eee
commit 99c21957de
@@ -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")