Skip to content

Commit b87f870

Browse files
committed
test(execution): isolate rate-limit gate test from STEP 7 reservation
The 'consumes the rate-limit gate once' test reached the STEP 7 admission reservation, which depends on Redis — it passed locally (reserve throws and is swallowed) but failed in CI (reserve returns not-reserved -> 429). Pass skipConcurrencyReservation so the test isolates the rate gate deterministically.
1 parent eb074db commit b87f870

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/sim/lib/execution/preprocessing.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ describe('preprocessExecution ban gate', () => {
257257
it('consumes the rate-limit gate exactly once when the ban and usage gates pass', async () => {
258258
mockCheckRateLimit.mockResolvedValue({ allowed: true, remaining: 5, resetAt: new Date() })
259259

260-
const result = await preprocessExecution({ ...baseOptions, checkRateLimit: true })
260+
// skipConcurrencyReservation bypasses the STEP 7 admission reservation so the
261+
// assertion isolates the rate gate and does not depend on Redis availability.
262+
const result = await preprocessExecution({
263+
...baseOptions,
264+
checkRateLimit: true,
265+
skipConcurrencyReservation: true,
266+
})
261267

262268
expect(result.success).toBe(true)
263269
expect(mockCheckRateLimit).toHaveBeenCalledTimes(1)

0 commit comments

Comments
 (0)