Skip to content

test(concurrent): pin that a sync slot waiter abandons when its request ends - #152

Merged
ThomasK33 merged 1 commit into
mainfrom
test/sync-slot-waiter-abandon
Oct 30, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
test/sync-slot-waiter-abandon

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Why

No test pinned that a DispatchSync request waiting for a concurrency slot gives up when its request context ends. A change that made the abandon branch wait for the slot and run the handler anyway passed the whole root suite. This PR adds the missing test. Closes #151.

What changed

  • TestConcurrentSyncSlotWaiterAbandonedWhenRequestEnds in concurrent_test.go. The only slot stays held. The test cancels the waiter's request context and asserts that the request returns 200, the handler never runs (also after the slot frees), the abandoned wait is logged for that event, and the observer records ignored.

Scope

  • Test only. No runtime code changes.

Verification

  • go test -race -run '^TestConcurrentSyncSlotWaiterAbandonedWhenRequestEnds$' -count=50 . passes. The full root suite passes under -race.
  • Red check from the triage comment. I changed the ctx.Done() branch of acquireConcurrencySlot to c.concurrencySlots <- struct{}{}; return true. The new test then fails:
    --- FAIL: TestConcurrentSyncSlotWaiterAbandonedWhenRequestEnds (0.00s)
        concurrent_test.go:359: waiter request did not return after its context ended
    
    Without that change, it passes.

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

…st ends

Under DispatchSync with the concurrent strategy, a request waiting inline for a MaxConcurrent slot must give up when its context ends: it returns 200, logs the abandoned wait, records an ignored outcome, and never runs its handler, even after the slot frees.

Closes #151

Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T13:54:29.638442Z a2e9f23 Manual request
🔒 Security Review ✅ Completed 2026-10-30T13:54:51.549559Z a2e9f23 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: a2e9f23497

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: a2e9f23497

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 merged commit 887077d into main Oct 30, 2026
3 checks passed
@ThomasK33
ThomasK33 deleted the test/sync-slot-waiter-abandon branch October 30, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: no test covers a sync-dispatch slot waiter whose request ends

1 participant