Repository navigation
test(adapters/linear): assert the deadline branch returns RateLimited in the deadline test - #116
Conversation
… in the deadline test TestRateLimitDeadlineReturnsTypedRateLimited checked only that a 429 with a backoff past the caller deadline returns *linear.RateLimited. The attempt cap and the MaxElapsed ceiling return the same type, so the test passed whichever branch fired. It now records the "outcome" attribute of the adapter's retry log, through the public Options.Logger field, and requires exactly ["deadline"]. Fixes #111 _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Fixes #111
What changed
TestRateLimitDeadlineReturnsTypedRateLimitedchecked that a 429 whose backoff ends past the caller deadline returns*linear.RateLimited. Three branches indoJSONWithRetry(adapters/linear/retry.go) return that type: the attempt cap, theMaxElapsedceiling and the deadline check. The test passed whichever one fired.The test now passes a recording
slog.Handlerthrough the publiclinear.Options.Loggerfield. The handler keeps theoutcomeattribute of eachlinear rate limitedrecord. AfterPostThoughtreturns, the test requires the outcomes to equal["deadline"]: the deadline branch returned the error and no other retry decision happened.Test code only. No production change and no new seam. The test keeps the #110 timing approach (10 s deadline, 5 s bound on the result). The new assertion adds no timing assumption.
Red check
I changed
retry.gofor one run each and restored it after.retry.gomainfalse && ok)elapsed+delay >= policy.MaxElapsed)retry outcomes = ["ceiling"], want ["deadline"]Validation
go test -race -count=200 -cpu=1 -run TestRateLimitDeadlineReturnsTypedRateLimited ./adapters/linear/: 200 pass, 0 fail.-racetest binary, each-count=50 -cpu=1: 2400 pass, 0 fail.mise run vetandmise run testwith Go 1.27.1: pass.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high