node-tools: a test's wait on the bus takes the test's own deadline (issue 1754, review round 1)

The lead's answer on issue 1754 (note of 2026-11-23 20:00, principles 11
and 7): no bound written into the code. meshtest.Bound(t) is t.Deadline()
less 30 s for the test's cleanup, go test's default of 10 min where a run
names no deadline, and what is left, at least 1 ms, once less than the
margin is (the lead's round-2 answer, note 11; principles 3 and 7). Until
stops at it; callWithin is gone, call() takes it. The guard now refuses
any constant bound of a second or more.

Each upper limit is half the bound it tells apart: the watch's refusal is
held to half the default StateTimeout the test replaced (a watch timer
fixed at 10 s failed it in 10.0 s, round 1 passed it); the console's close
to half its backstop ShutdownWithin (a Close that never cancels failed it
in 5.1 s, round 1 passed it); the console waits to half WaitDefault.

Builds: issue 1754 notes 10 (lead answer, 20:00) and 11 (round 2: margin, AC1, AC4); principles 3, 7 and 11
This commit is contained in:
2026-11-23 20:11:13 +01:00
parent 6a1b4817f8
commit 56d20314ba
23 changed files with 143 additions and 90 deletions
+3 -3
View File
@@ -89,7 +89,7 @@ func TestACallOnTheCallerNamedSubjectReachesTheModuleWithItsCaller(t *testing.T)
Result saidCaller `json:"result"`
}
mt.Until(t, func() error {
answer, err := raw.RequestMsg(msg, mt.Bound)
answer, err := raw.RequestMsg(msg, mt.Bound(t))
if err == nil {
err = json.Unmarshal(answer.Data, &reply)
}
@@ -131,7 +131,7 @@ func TestTheSubjectThatNamesNoCallerStillWorksAndNamesNone(t *testing.T) {
Error string `json:"error"`
}
mt.Until(t, func() error {
msg, err := old.Request(subject, body, mt.Bound)
msg, err := old.Request(subject, body, mt.Bound(t))
if err == nil {
err = json.Unmarshal(msg.Data, &reply)
}
@@ -254,7 +254,7 @@ func TestTheSubjectThatNamesNoCallerStillWorksAndNamesNone(t *testing.T) {
for i := 0; i < 3; i++ {
go func() { got, err := c.chunkedAsked("seat:mesh-wants.input"); done <- got && err == nil }()
}
for deadline := time.Now().Add(mt.Bound); c.rereadWaiting() < 2; runtime.Gosched() {
for deadline := time.Now().Add(mt.Bound(t)); c.rereadWaiting() < 2; runtime.Gosched() {
if time.Now().After(deadline) {
t.Fatal("two asks never joined the read running")
}