Skip to content
Antenore Gatta

Antenore Gatta

A proud and busy Hacker, Father and Kyndryl.

API Gateway throttles CORS preflights, and the failure lands on the next test

- 1 min

A throttled CORS preflight fails with no status the app shows, so the error lands on whatever runs next.

Our e2e run went red on a settings page: no “Saved” confirmation, the field empty after reload, then a click timeout on a disabled Save button. The day’s changes had touched that code, so everything pointed at the change.

The diff said the validation logic was fine. The access logs said something better: the request never reached the backend. API Gateway answered 429 to the OPTIONS preflight, routeKey “-“, no integration. The stage throttle of 50 requests per second, burst 100, was already spent.

The scenario before it opened a screen that fired 124 parallel GET requests to a list endpoint. Plus 124 preflights, same second. Stage throttling counts preflights too, so a fan-out of N requests can cost 2N.

Run alone, the failing scenario passed 9 out of 9. The bursts and preflight 429s were already in earlier runs. That day the 429 just landed on a Save.

When an e2e failure sits next to code you just changed, read the access logs before the diff. Status, routeKey, integration: they separate “never arrived” from “arrived and failed.”

The real fix is in the client: cap the concurrency or read once. Raising the gateway limit just moves the budget.

Drafted with AI assistance from notes I took during real work.

Antenore Gatta

Antenore Gatta

A proud and busy Hacker, Father and Kyndryl

Support This Work

If this saved you an afternoon chasing a test that was never broken, consider a small contribution.

Most readers scroll past. Less than 3% of readers contribute to keeping independent technical content free and accessible.

Post comment

Markdown is allowed, HTML is not. All comments are moderated.