Fold the call-bound check into the answer-bound settings test (test budget)
mesh/delivery merged: source.main moved to novox/mesh-delivery@8f83608503da
mesh/check being carried to bedda86a22c5 on 8f83608503da | from a62276bcafad

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
2026-11-03 01:26:26 +01:00
parent 0e26fd8ed5
commit bedda86a22
@@ -32,24 +32,15 @@ func TestTheAnswerBoundIsTheCheckersSetting(t *testing.T) {
if (err != nil) != row.err || got != row.want {
t.Errorf("%q: %s, %v", row.body, got, err)
}
}
}
// Issue 1126, ADR 0593 §7: the SDK's call gives up at CallTimeout (30 s), so an engine answering at 31 s is lost under a
// 60 s answer bound unless the checker's calls wait the bound; the bound never shortens the SDK's own.
func TestCallsWaitTheComposeAnswerBound(t *testing.T) {
was := process.CallTimeout
defer func() { process.CallTimeout = was }()
for _, row := range []struct{ bound, want time.Duration }{
{delivery.ComposeAnswerBound, delivery.ComposeAnswerBound}, {10 * time.Second, was}, {600 * time.Second, 600 * time.Second},
} {
process.CallTimeout = was
holdCallsFor(row.bound)
if process.CallTimeout != row.want {
t.Errorf("bound %v: calls wait %v, want %v", row.bound, process.CallTimeout, row.want)
}
if row.bound > 31*time.Second && process.CallTimeout < 31*time.Second {
t.Errorf("an answer at 31 s would be lost under bound %v", row.bound)
// Issue 1126: the SDK's call gives up at CallTimeout (30 s), so the checker's calls must wait the bound read
// (an answer at 31 s is heard under 60 s), and the bound never shortens the SDK's own.
if err == nil {
was := process.CallTimeout
holdCallsFor(got)
if process.CallTimeout < got || process.CallTimeout < was {
t.Errorf("%q: calls wait %v under bound %v", row.body, process.CallTimeout, got)
}
process.CallTimeout = was
}
}
}