Skip to content

test(concurrent): pin that a slot waiter abandons at its DetachTimeout - #150

Merged
ThomasK33 merged 1 commit into
mainfrom
test/concurrent-detach-timeout-abandon
Oct 30, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
test/concurrent-detach-timeout-abandon

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Why

The goal is to land every open follow-up from the concurrent strategy work, one small reviewed PR each. This one adds the missing test from #146: no test failed when a slot waiter kept waiting past its DetachTimeout and then ran its handler.

What changed

  • New TestConcurrentSlotWaiterAbandonedAtDetachTimeout in concurrent_test.go. It runs in a testing/synctest bubble with MaxConcurrent: 1. The first handler holds the only slot while the second delivery's DetachTimeout expires.
  • The test checks that the waiter logs "chat concurrent slot wait abandoned" with context deadline exceeded, ends its dispatch span as ignored, and never runs its handler, also after the slot frees.

Scope

Verification

  • Red check from the triage (the abandon branch of acquireConcurrencySlot returns true): the new test fails in 20 of 20 separate runs (a -count=20 run stops at the first failure, because the bubble then panics). On current main this mutation also fails TestConcurrentSlotWaiterDrainedByShutdown and hangs TestConcurrentSlotFreedDuringShutdownIsAbandoned until the go test timeout, because the waiter releases a slot it never took and Shutdown never drains. So the gap is narrower than the issue says.
  • Red check for the exact gap (the abandon branch waits for the slot, then returns true): the new test fails, and the rest of the root suite passes. Without this PR, nothing catches that runtime.
  • go test -race -count=50 -run 'Concurrent' ., go test -race ./..., and the vet, test:root, test:adapters, test:examples commands from mise.toml all pass on the head.

Closes #146


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

A deferred tail that waits for a MaxConcurrent slot must give up when its
DetachTimeout expires, even while the slot stays held. No test checked
this path: a runtime whose waiter kept waiting and then ran its handler
passed the whole root suite.

The new test runs in a synctest bubble. It holds the only slot, lets the
waiter's DetachTimeout expire, and checks that the waiter logs the
abandon, ends its dispatch span as ignored, and never runs its handler,
also after the slot frees.

Refs #146
@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-30T11:08:06.192479Z 68cb0b4 Manual request
🔒 Security Review ✅ Completed 2026-10-30T11:07:54.795271Z 68cb0b4 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 Security Review

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

Reviewed commit: 68cb0b4775

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 68cb0b4775

ℹ️ 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".

@ThomasK33
ThomasK33 merged commit abc9753 into main Oct 30, 2026
3 checks passed
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: concurrent strategy gaps (DetachTimeout expiry is untested, bound test can take 10 min to fail)

1 participant