test(e2e): Avoid rate limits when polling Sentry in send-to-sentry tests (#24957)
The send-to-sentry E2E tests often fail with `429 Too Many Requests`
("Limit is 40 requests in 1 seconds"). Sentry rate limits GET requests
per token owner, and every endpoint used here shares the default bucket.
So all E2E jobs across all PRs share one 40 req/s budget.
Most of the load came from `sentry trace view --json`. The `--json` flag
makes the CLI fetch details for every span, one request each (15 at a
time), on top of a project lookup and the trace request. Every 5s poll
turned into dozens of requests. `fetchTrace` now calls the trace
endpoint directly through `sentry api`, which is one request per poll.
The tests only read fields that the raw trace response already includes
(`event_id`, `parent_span_id`, `event_type`, `op`, `description`,
`children`, `errors`, `occurrences`).
All the polling helpers now also treat a 429 as "not there yet" and keep
polling until the existing timeout, instead of failing on the first
rate-limited response.
<!-- junior-request-attribution:start -->
via **Jan Peer Stöcklmair**.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3ACUHS29QJ0%3A1790866806.848059 -->
--
[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3ACUHS29QJ0%3A1790866806.848059)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3ACUHS29QJ0%3A1790866806.848059/?project=4510944073809921)
<!-- junior-session-footer:end -->
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Jan Peer Stöcklmair <jan.peer@sentry.io> S
sentry-junior[bot] committed
90db3194a6fbe0c918c88e062480b2e64083d79b
Parent: dd93cce
Committed by GitHub <noreply@github.com>
on 10/1/2026, 5:46:44 PM