Skip to content

test: concurrent strategy gaps (DetachTimeout expiry is untested, bound test can take 10 min to fail) #146

Closed

Description

@ThomasK33

Two gaps in the concurrent strategy's tests, found by the independent verifier of #144. Neither is a runtime bug today.

  1. No test catches a slot waiter that runs after its DetachTimeout. When a slot waiter's context ends, acquireConcurrencySlot logs "slot wait abandoned" and returns false (runtime.go#L1224-L1226). The verifier changed that branch to return true, so the waiter would run its handler anyway. The whole root test suite still passed, with the test from before test(concurrent): check the MaxConcurrent bound across the whole slot wait #144 and with the one after it.
  2. TestConcurrentBoundedByMaxConcurrent can take 10 minutes to fail. Since test(concurrent): check the MaxConcurrent bound across the whole slot wait #144 it runs in a testing/synctest bubble. If a broken runtime leaves a goroutine blocked on a sync.Mutex, synctest.Wait (concurrent_test.go#L148) waits until the go test timeout (10 minutes by default) instead of failing at once. The test before test(concurrent): check the MaxConcurrent bound across the whole slot wait #144 failed the same broken runtime in 2 s. CI still reports the failure within its 30-minute job limit.

Possible fix

  1. Add a test where a slot waiter's DetachTimeout expires while the slot stays held, then assert its handler never runs and the abandon is observable.
  2. Decide whether the 10-minute worst case is acceptable. If it is not, put a bound around the bubble, for example a deadline in TestMain or a short -timeout for this package in CI.

Owner and trigger

The coder/chat maintainer triages this. Fix item 1 with the next change to the concurrent strategy.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh

Activity

  1. added
    needs-triageMaintainer needs to evaluate this issue
    enhancementNew feature or request
    ready-for-agentFully specified, ready for an AFK agent
    and removed
    needs-triageMaintainer needs to evaluate this issue
    on Oct 30, 2026
  2. ThomasK33 commented on Oct 30, 2026

    @ThomasK33
    MemberAuthor

    Triage: ready-for-agent for item 1. I decided item 2.

    • Item 1: the fix in the issue is the plan. Use the same red check that the verifier used: change the abandon branch to return true, and show that the new test fails. Then restore the branch.
    • Item 2: I accept the 10-minute worst case, so no change. The test fails only on a broken runtime, and CI still reports the failure within its job limit. A watchdog around the synctest bubble adds a second clock and more test code for a case that a red run already exposes. Revisit this if the slow failure costs a real debugging session: then add a short -timeout to that one test's local run instructions, not to CI.

    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions