From 33882e2265c51d189033322e4868c34c990fd0af Mon Sep 17 00:00:00 2001 From: Tynan Daly Date: Fri, 8 May 2026 15:25:20 -0700 Subject: [PATCH] fix(timeouts): bump APILong to 120s and integration test timeout to 180s Integration tests have been flaking in CI on every PR \u2014 typically `TestBranchLifecycle` or `TestCommitAndRunCommit` timing out on a `vers branch` or `vers run-commit` invocation. Three reruns of PR #183 each failed on a different live-API call, all with the same 60-77s timeout shape. Root cause: two timeouts were both set to 60s, so the test wrapper had zero margin over the CLI's own internal context budget. When VM provisioning legitimately took 60+ seconds, both timers raced \u2014 the test wrapper killed the process before the CLI could either complete or surface a clean deadline-exceeded error. Empirically: - Local profiling: `vers branch` is 5-6s when run in isolation but occasionally 60-130s when the full integration suite is running (likely API state / queue interference) - Full suite passes in 85-138s with the new timeouts; would have failed with the old 60s on any individual call exceeding 60s Fix: - APILong: 60s -> 120s (CLI's own context budget for long ops) - testutil.DefaultTimeout: 60s -> 180s (test wrapper, kept above APILong so the CLI can error gracefully before the wrapper kills it) Verified locally with 4 consecutive full-suite runs: 138s, 86s, 89s, 86s. --- internal/app/timeouts.go | 2 +- test/testutil/helpers.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/app/timeouts.go b/internal/app/timeouts.go index 1804948..c99dadd 100644 --- a/internal/app/timeouts.go +++ b/internal/app/timeouts.go @@ -16,7 +16,7 @@ func DefaultTimeouts() Timeouts { return Timeouts{ APIShort: 10 * time.Second, APIMedium: 30 * time.Second, - APILong: 60 * time.Second, + APILong: 120 * time.Second, BuildUpload: 600 * time.Second, SSHConnect: 5 * time.Second, } diff --git a/test/testutil/helpers.go b/test/testutil/helpers.go index 42dacf2..2f81381 100644 --- a/test/testutil/helpers.go +++ b/test/testutil/helpers.go @@ -14,7 +14,11 @@ import ( ) const ( - DefaultTimeout = 60 * time.Second + // DefaultTimeout caps each `vers` invocation in integration tests. + // Must exceed the CLI's longest internal context budget (APILong = 120s) + // so the CLI gets room to either succeed or return a clean + // context-deadline error before the test wrapper kills the process. + DefaultTimeout = 180 * time.Second ) var (