claude-code: the again tool answers every operator's session and the healers; the seat-list case waits on the reader's Ready (ADR 0636 §7; issue 1966)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -105,6 +105,13 @@ func TestTheMeshsToolsAreReadFromTheBus(t *testing.T) {
|
||||
if got := strings.Join(addresses, ","); got != "mesh-module-assigner.placement,node-service-manager.status,node-service-manager.journal,docker.docker_logs" {
|
||||
t.Errorf("replacements: %s", got)
|
||||
}
|
||||
t.Run("the again tool answers the operator and the healers only", func(t *testing.T) {
|
||||
for caller, refused := range map[string]bool{"person.jochen": false, "shanks.mesh-healers": false, "shanks.mesh-config": true} {
|
||||
if err := seatlist.Refusal("claude_code_seat_list_again", seatListAgainCallers, caller); (err != nil) != refused {
|
||||
t.Errorf("%s: refused=%v, err %v", caller, refused, err)
|
||||
}
|
||||
}
|
||||
})
|
||||
t.Run("the seats are the seat list read from the bus", func(t *testing.T) {
|
||||
// A table made from what the seat mesh-catalog answers (ADR 0635 §1): no compiled list, so before the reader
|
||||
// has started nothing replaces a command, and after it the seats' verbs are the seat's own.
|
||||
@@ -116,13 +123,11 @@ func TestTheMeshsToolsAreReadFromTheBus(t *testing.T) {
|
||||
}
|
||||
startSeatList(listBus{"mesh-module-assigner": someSeats()[0], "node-service-manager": someSeats()[1]})
|
||||
defer func() { seatListMu.Lock(); seatList = nil; seatListMu.Unlock() }()
|
||||
// The reader reads on its own goroutine: wait for the change it tells (no sleeping).
|
||||
for !seatList.Status().Heard {
|
||||
select {
|
||||
case <-meshChanged:
|
||||
case <-time.After(10 * time.Second):
|
||||
t.Fatalf("the seat list was not read: %+v", seatList.Status())
|
||||
}
|
||||
// The reader's first read ends when Ready closes (no sleeping).
|
||||
select {
|
||||
case <-seatList.Ready():
|
||||
case <-time.After(10 * time.Second):
|
||||
t.Fatalf("the seat list was not read: %+v", seatList.Status())
|
||||
}
|
||||
got, err := ReadMeshToolsFrom(aMesh(t), definedSeats(), resolving)
|
||||
var addrs []string
|
||||
|
||||
Reference in New Issue
Block a user