From 8875af33cba45a74988f53e6dfa51bfcd45ed0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Almeida?= Date: Tue, 12 May 2026 00:05:42 +0100 Subject: [PATCH] docs(test): update stale comment after retry-delay became cancelable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit aaec9e87 swapped the retry sleep for a select on ctx.Done. The test comment in TestWaitForAgentctlHealth_HonoursContextCancellation still described the old "subsequent time.Sleep is short" reasoning, which is no longer how cancellation propagates — the select exits immediately via ctx.Done() within the same iteration. --- .../agent/lifecycle/executor_docker_reconnect_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/backend/internal/agent/lifecycle/executor_docker_reconnect_test.go b/apps/backend/internal/agent/lifecycle/executor_docker_reconnect_test.go index d144780ceb..b451dc53b1 100644 --- a/apps/backend/internal/agent/lifecycle/executor_docker_reconnect_test.go +++ b/apps/backend/internal/agent/lifecycle/executor_docker_reconnect_test.go @@ -125,8 +125,9 @@ func TestWaitForAgentctlHealth_HonoursContextCancellation(t *testing.T) { if !errors.Is(err, context.Canceled) { t.Fatalf("expected context cancellation, got %v", err) } - // One Health() call before the loop notices cancellation; the subsequent - // time.Sleep is short so cancellation gets observed promptly. + // One Health() call before the loop notices cancellation; the cancelable + // select exits immediately via ctx.Done() so cancellation is observed + // within the same iteration. if got := atomic.LoadInt32(&stub.calls); got > 2 { t.Fatalf("expected ≤2 Health() calls before honouring cancellation, got %d", got) }