Repository navigation
test(web): pace dashboard e2e under the API rate limit and pin the sign-in org - #2881
Merged
Merged
Conversation
All CI runs share one Clerk test user, so a fresh sign-in can open in another run's fixture organization that this run's database never provisioned. session-isolation's two sign-ins now activate the expected organization the way global setup does, through a shared helper. This also stops the re-sign-in from leaving the shared dev-browser client in a foreign organization, which failed theme.e2e with "Organization is not provisioned". The spec also deletes "Session isolation" fixture organizations older than an hour that killed runs left on the test user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every dashboard spec signs in as one Clerk user, and each dashboard page load makes about nine sdp-api requests, so the single-worker suite runs at CLERK_USER_MAX_REQUESTS (600 a minute). Whichever test crosses it gets a 429 and an error page, which is how session-isolation flaked on main. Before each test, and before a suite provisions fixtures, the run now reads the API's own sliding-window counters from its Redis and waits until 150 requests are free. It waits only when the next test could run out, and only as long as that takes. Each check and each test's ending count is written to test-results/rate-budget.jsonl, which CI uploads, so the headroom can be tuned from real runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Windscar
marked this pull request as ready for review
November 13, 2026 06:44
Contributor
[Low impact] The PR appears safe to merge; the previous finding is fixed and no new blocking issue was found. SummaryThis PR adds rate-limit pacing to dashboard tests and pins the expected organization after sign-in.
Reviews (4) · Last reviewed commit: "test(web): read window.Clerk through Cle..." · Reviewed by Greptile |
Review fixes for the dashboard e2e pacing helper: - the headroom env value and the Redis SCAN/MGET replies are parsed with zod - a Redis connection that closes before replying rejects instead of hanging - a local run that cannot read its counters, or whose budget never frees up, fails with that reason instead of starting the test anyway - the fixture file exports only `test`; specs import `expect` and types from @playwright/test, and imports use the app alias - the uploaded log leaves out the Clerk user and org ids Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The API launcher resolves REDIS_URL from Kora's api.env and apps/sdp-api/.env.local before the process env, falling back to redis://127.0.0.1:6379, so a runner without REDIS_URL failed before any test and a runner with a different one paced against the wrong counters. The pacing helper now resolves it the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clerk/testing/playwright declares window.Clerk globally, so the helper reads it directly instead of casting window through unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windscar
enabled auto-merge (squash)
November 13, 2026 15:08
multipletwigs
approved these changes
Nov 13, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the dashboard e2e flake on main (
session-isolation.e2e.spec.ts), which has two separate causes. Test harness only: no API or product change.CLERK_USER_MAX_REQUESTS(600/min). Whichever test crosses it gets a 429 and an error page.PLAYWRIGHT_RATE_LIMIT_HEADROOM). Specs importtestfromplaywright/support/test.ts.test-results/rate-budget.jsonl, which CI uploads, so the headroom can be tuned from real runs.theme.e2e401s). Both sign-ins now pin the org, and staleSession isolationorgs older than an hour are deleted.Verification: dashboard suite run locally (35 passed; 2 pauses, about 3s; peak 463/600). Typecheck and biome clean. CI on this PR is the first run on CI hardware.
🤖 Generated with Claude Code