From bedda86a22c5f9e76172019a7da3213afe6d4e86 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 01:26:26 +0100 Subject: [PATCH] Fold the call-bound check into the answer-bound settings test (test budget) Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL --- .../mesh-delivery-checker/settings_test.go | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/modules/mesh-delivery-checker/cmd/mesh-delivery-checker/settings_test.go b/modules/mesh-delivery-checker/cmd/mesh-delivery-checker/settings_test.go index ed6e148..ad9a986 100644 --- a/modules/mesh-delivery-checker/cmd/mesh-delivery-checker/settings_test.go +++ b/modules/mesh-delivery-checker/cmd/mesh-delivery-checker/settings_test.go @@ -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 } } }