Aller au contenu
login
arrow_backRetour aux issues
kubestellar/hive #4628

[quality] pkg/agent suite exceeds go test's 600s default timeout on live hive hosts — tmux-exec-bound tests

ecoDébutant help wanted quality testing hive/hosted-available-oke-11-placeholder-r05x agent/quality

descriptionDescription

## Finding On a live hive host, `go test ./pkg/agent/ -count=1` panics with `test timed out after 10m0s` (the Go default). It is not one deadlocked test: the timeout lands on whichever tmux-exec-heavy test happens to be running when the budget runs out — observed on `TestRunCopilotDiagnostic_CLIReady` (120s run) and `TestConcurrentPauseResume_NoPanic` (420s run, after 560 tests had already passed with 0 failures). Two structural causes: 1. **Real tmux execs against the live shared tmux server.** `TestConcurrentPauseResume_NoPanic` runs 5 goroutines × 50 `Pause`/`Resume` cycles, and `Manager.Pause` calls `tmuxSendKeysForAgent` (manager.go ~7975), i.e. ~500 real `tmux` process spawns per run. On a loaded host with live agent sessions each exec is slow, and the test both takes minutes and interacts with the production tmux server — the same hermeticity class as #4585/#4622. 2. **Many wall-clock-bound diagnostic tests** (`TestRunCopilotDiagnostic_*` at ~3–12s each, etc.) push the whole package past 600s under load, so the suite fails even when every assertion passes. Coverage collection is also affected: the timeout aborts profile writing, which is how `stuck_login_diagnosis.go` showed a false 0% in a full-repo coverage run despite having a 347-line test file. ## Recommendation - Give `TestConcurrentPauseResume_NoPanic` a tmux seam (stub `tmuxSendKeysForAgent`/the tmux binary, as `overrideStub` does elsewhere) or drastically reduce the iteration count — the race it pins is in the mutex accounting, not in tmux. - Audit `pkg/agent` tests that exec the real tmux binary against the default socket for live-host interaction (they can send keys to real `hive-` sessions if names collide). - Consider `-timeout` headroom and/or `t.Parallel()` for the wall-clock-bound diagnostic tests in CI. Companion PR #4627 already fixes the two outright live-host FAILures in the same package (`TestAgentAuthState_*`), so after this issue the package would be green and bounded on live hosts. ## Priority - Impact: medium (blocks `go test ./pkg/agent` on live hosts; false coverage data; touches production tmux server) - Effort: medium --- *Filed by quality agent (hold-gated mode)* --- 🐝 **Hive Agent**: `quality` | **Instance:** `hosted-available-oke-11-placeholder-r05x` | **SHA:** `unknown` — hive: agent=quality backend=copilot model=claude-fable-5
codeOuvre sur GitHub