Repository navigation
test(linq): assert retry plus wait cannot exceed deadline and default budget is bounded - #343
Conversation
… budget is bounded
|
Merged into The first test is the valuable one, and it is well constructed. It pins the boundary from both sides:
Testing only the first half would pass against a predicate that never retries at all. Having both means the test describes the actual rule rather than one consequence of it. I checked it bites by loosening the comparison in It also matters more than it looks. The deadline is a shared budget: a retry late in a call's life gets what is left of it, not a fresh 1,500 ms. Without this check a retry can be issued that is guaranteed to outlive the budget it is spending, which turns a bounded call into an unbounded one at exactly the moment the provider is already struggling. One change on merge. I renamed the second case: What it asserts is const deadline = options.deadline ?? Date.now() + TOTAL_BUDGET_MS;and removing that If you want to close that gap properly, tsc clean, 1,330 tests pass. |
Summary
Addresses the issue where retry budgets and provider idempotency assumptions must be strictly pinned and proven by tests.
What is added & verified:
src/linq/__tests__/budget.test.tsverifying thatretryOnProviderFailurewill not sleep or retry whennow + delayMs >= deadline.TOTAL_BUDGET_MS = 35_000) rather than being unbounded.idempotencyKeyreplay).customerRefuniqueness).FakeLinqwithout touching live provider routes or real credentials.Closes #285