Files
mesh-host/internal/link/replay331_test.go
T
jochen 3abb07f1e2
mesh/delivery superseded: a newer head of the same pull request
mesh/merge-gate pass: builds mesh-host → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed
State a tool check that waits for the operator as waiting (issue 386, ADR 0283)
A module whose only fault was a secret the operator had not given yet was
stated unhealthy, failed its first-node gate and was put back. The engine
now reads the tool's answer through mesh-sdk go/health and states such a
resource waiting, with what it waits for, on one look; a malformed wait
stays unhealthy.
2026-10-10 21:11:02 +02:00

26 lines
1.0 KiB
Go

package link
import (
"strings"
"testing"
)
// TestReplay331 is the replay of hq issue 331 (mesh-lab R331), written with only what the node-engine had
// before its fix so it can be laid over the commit before: every declared tool check on a live machine
// read "no link to the bus is open" while the link was up, because the link the engine attaches — the NATS
// link — could not ask a tool, and the queue said that as no link.
//
// The NATS link is attached with no connection under it, so no bus is needed: the question must reach the
// link and fail there, not stop at the queue as if no link were open.
func TestReplay331(t *testing.T) {
q := &Queue{Membership: Membership{Node: "laptop"}}
q.attach(t.Context(), &natsLink{node: "laptop"})
_, err := q.AskTool(t.Context(), "sensors", "sensors_health")
if err == nil {
t.Fatal("asked on no connection and was answered")
}
if strings.Contains(err.Error(), "no link to the bus is open") {
t.Fatalf("a tool check on the attached NATS link was refused as no link: %v", err)
}
}