node-tools: every wait on the bus in a test waits the shared bound, not a few seconds (issue 1754)
TestAStaleWriteIsRefusedAndWritesNothing gave the watch 5 s to hear a 1 s key's expire and failed main.505's integration step on a loaded build node; TestARunnerAtItsStopAnswersNoCallAndItsCallersMeetNoResponders failed its rerun while it asked 1 s of two round trips and 5 s and 10 s of its waits. The second of a kind after3850eb8, so the kind is fixed: meshtest.Bound (30 s, Until's bound, named once) is what every node-tools test that starts a bus waits for what the bus carries; Until becomes a deadline of it, so a try that waits does not multiply it; an upper bound on how long a call or a wait took is half the bound it tells apart (bus.RequestTimeout, the call's or the wait's own), at most meshtest.Bound. A wait that hears ends then: no passing test is longer (per-test durations before and after, equal). A guard (meshtest waits_test.go) reads every test file that imports meshtest and refuses a wait whose constant bound is a second or more under meshtest.Bound; it names 34 such waits at309069de. Builds: issue 1754 note 8 (the quick fix), note 9 (1754/AC1 to AC4); principle 11
This commit is contained in:
@@ -26,9 +26,10 @@ func connect(t *testing.T, module, node string) *bus.Conn {
|
||||
return c
|
||||
}
|
||||
|
||||
// callWithin is the tests' own bound on a call (principle 11, design 47 H, H-A-158): a call that is never answered
|
||||
// fails the try it is part of within it, never after the tool runner's own 30 s.
|
||||
const callWithin = 2 * time.Second
|
||||
// callWithin is the tests' own bound on a call (principle 11): the shared meshtest.Bound, which a loaded build node stays
|
||||
// within where 2 s did not (1754/AC1); a call that is never answered fails there, and Until, a deadline of the same bound,
|
||||
// does not try it again past it.
|
||||
const callWithin = mt.Bound
|
||||
|
||||
func call(t *testing.T, asker *bus.Conn, key string, args any) (string, error) {
|
||||
t.Helper()
|
||||
@@ -119,7 +120,7 @@ func TestTheNodesRuntimeServesFiveModulesAndFollowsAReissuedMembership(t *testin
|
||||
if subject != "mesh.mod.alpha.event.happened" {
|
||||
t.Errorf("the event landed on %s", subject)
|
||||
}
|
||||
case <-time.After(5 * time.Second):
|
||||
case <-time.After(mt.Bound):
|
||||
t.Error("the event never landed")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user