Skip to content

Commit 3e21116

Browse files
committed
Fix flaky spawn-agent-real-chat-prompt-test on slow CI runners
The future deref timeout was 5s, but chat/prompt runs its work in a future* and the spawn-agent polling loop sleeps 1s between status checks. On slower runners (notably macOS GitHub runners with cold JIT) a healthy run can take a few polling iterations and bump up against the 5s budget, producing a false-positive 'spawn handler did not complete' failure. Bump to 30s; a real regression hangs the loop forever so the test still fails fast under that scenario.
1 parent 2bb20af commit 3e21116

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

test/eca/features/tools/agent_test.clj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,13 @@
652652
;; Run in a future with a timeout so a regression that causes
653653
;; chat/prompt to reject the subagent chat-id (and thus never
654654
;; flip the chat to :idle) fails the test instead of hanging
655-
;; the polling loop forever.
655+
;; the polling loop forever. The budget is generous because
656+
;; chat/prompt does its real work in a future* and the agent
657+
;; polling loop in agent.clj sleeps 1s between status checks,
658+
;; so on slower CI runners (notably macOS GitHub runners with
659+
;; cold JIT) a healthy run can still take a few polling
660+
;; iterations. A genuine regression hangs forever, so 30s is
661+
;; still a fast failure for that case.
656662
result-fut (future
657663
(handler
658664
{"agent" "explorer" "task" "find files" "activity" "exploring"}
@@ -663,12 +669,12 @@
663669
:chat-id "parent-1"
664670
:tool-call-id "tc-1"
665671
:call-state-fn (constantly {:status :executing})}))
666-
result (deref result-fut 5000 ::timeout)]
672+
result (deref result-fut 30000 ::timeout)]
667673
(when (identical? ::timeout result)
668674
(future-cancel result-fut))
669675
(testing "spawn handler completes (regression would hang the polling loop)"
670676
(is (not (identical? ::timeout result))
671-
"spawn handler did not complete in 5s — chat/prompt likely rejected the subagent chat-id"))
677+
"spawn handler did not complete in 30s — chat/prompt likely rejected the subagent chat-id"))
672678
(when (map? result)
673679
(testing "spawn handler returns success (would be :error true under v0.133.1)"
674680
(is (match? {:error false

0 commit comments

Comments
 (0)