Skip to content

ref: Lint tests for awaits in loops and fix #2773 review - #2793

Merged
BYK merged 7 commits into
mainfrom
ref/lint-tests-await-in-loop
Dec 2, 2026
Merged

BYK merged 7 commits into
mainfrom
ref/lint-tests-await-in-loop

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Turns no-await-in-loop on for test files and fans out the awaits that review of #2773 flagged as needlessly sequential.

Tests. The override that switched the rule off for test files is gone. Independent iterations in tests now run with Promise.all. Loops whose iterations share mocks, fixtures, temp dirs, env vars or fake timers stay sequential, each with a disable comment that gives the reason.

CLI.

  • sentry event send sends files up to ORG_FANOUT_CONCURRENCY at a time and prints results in file order. If a send fails, the command throws the first failure in file order, but sends that already started or were queued still go out.
  • sentry project create creates the first project alone, since in an org with no teams it creates the team the rest reuse. It then creates the rest with mapBounded at ORG_FANOUT_CONCURRENCY and starts no new create after a failure. Creates already in flight when a failure happens (up to one window) can still finish. They appear in the partial output, which is still emitted before the error.
  • uploadCodeMappings uploads its 300-mapping batches with mapBounded at ORG_FANOUT_CONCURRENCY and merges the responses in batch order.

MCP core.

  • Alert rule details look up their detectors up to five at a time with p-limit, now a dependency of @sentry/mcp-core, and keep source order and the per-detector unavailable status.
  • generate-platform-setup resolves docs redirects for every platform in parallel, then builds its output in platform order.
  • generate-otel-namespaces fetches the non-custom namespace registries in parallel, then processes them in namespace order.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 4 commits December 2, 2026 12:58
Table loops whose cases share no state run with `Promise.all`: rejected
or read-only requests, completions, file reads and writes in separate
paths, cleanup unlinks, and per-case servers. Each case keeps its own
assertions. Loops over shared state stay sequential with a reason:
stores and buffers that keep insertion order, fake timers and clocks,
mocks swapped per case, cursors, streams, polling, CLI runs that share a
config directory, and MCP servers that take one connection at a time.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Drop the override that turned `no-await-in-loop` off for test files, so
the rule covers the whole repo.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…oncurrently

`event send` sends files up to ORG_FANOUT_CONCURRENCY at a time and
prints results in file order. `project create` creates the first project
alone, since it may create the team the rest reuse, then creates the rest
concurrently and starts no new create after a failure. Code-mapping
batches upload concurrently and merge in batch order.
Alert rule details look up detectors up to five at a time and keep
source order. The platform-setup and OTel namespace generators fetch
in parallel, then process the results in their original order.
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner December 2, 2026 13:41
@sentry-junior
sentry-junior Bot requested a review from BYK December 2, 2026 13:41
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Dec 2, 2026 1:59pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Dec 2, 2026 1:59pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 2, 2026
sentry-junior Bot and others added 2 commits December 2, 2026 13:45
…in-loop

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
The sourcemap inject and resolve tests that came in with main wrote their
independent fixture files in a loop, which the test lint now flags.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@BYK
BYK enabled auto-merge December 2, 2026 13:55
The cases are independent: each one plans, then judges its own plan.
Nothing backed the rate-limit reason for running them one at a time.
@vercel
vercel Bot temporarily deployed to Preview – sentry-local December 2, 2026 13:59 Inactive
@BYK
BYK added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit ba09503 Dec 2, 2026
77 of 81 checks passed
@BYK
BYK deleted the ref/lint-tests-await-in-loop branch December 2, 2026 14:31

This branch was successfully deployed

1 active and 2 inactive deployments
Preview – cli — ea95fc93 Deployed Dec 2, 2026 by vercel[bot]
Actions — ea95fc93 Deployed Dec 2, 2026 by sentry-junior[bot] via eval #2162
Preview – sentry-local — ea95fc93 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant