Skip to content

Commit 4dc38d5

Browse files
committed
test(chat): let every org E2E check share the socket-token throttle allowance
Which check runs out of a persona's token budget shifts as the suite grows, and the page retries after Retry-After. Scoped to this one error; Health still catches the rest.
1 parent 6de1280 commit 4dc38d5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎apps/sim/scripts/test-org-redesign-e2e.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ let currentCheck = 'Setup'
136136
let currentSection = 'Setup'
137137
/** What the running check expects to fail; everything else is reported. */
138138
let allowedFailures: RegExp[] = []
139+
/**
140+
* The token route limits per user and each document load mints one, while a persona opens pages
141+
* here far faster than anyone does. Which check runs out shifts as the suite grows, and the page
142+
* retries after the route's `Retry-After`, so a throttled mint never says anything about a check.
143+
*/
144+
const SOCKET_TOKEN_THROTTLED = /429 POST \/api\/auth\/socket-token/
139145

140146
const HANDLED_RUNTIME = /NEXT_REDIRECT|NEXT_HTTP_ERROR_FALLBACK/
141147
/** A Suspense boundary the server gave up on, which is only fine when it was a redirect or not-found. */
@@ -187,6 +193,7 @@ function pathOf(address: string) {
187193

188194
function recordProblem(kind: Problem['kind'], address: string, detail: string) {
189195
const signature = `${kind} ${address} ${detail}`
196+
if (SOCKET_TOKEN_THROTTLED.test(signature)) return
190197
if (allowedFailures.some((pattern) => pattern.test(signature))) return
191198
if (
192199
unexpected.some(
@@ -3249,8 +3256,6 @@ async function walkOne(persona: Persona, viewport: Viewport, theme: Theme) {
32493256
async function walkRoutes(personas: Persona[]) {
32503257
section('Route walk')
32513258
currentCheck = 'Route walk'
3252-
// The token route limits per user, and one persona opens a hundred pages here within minutes.
3253-
allowedFailures = [/429 POST \/api\/auth\/socket-token/]
32543259
const plan = personas.flatMap((persona) =>
32553260
[DESKTOP, PHONE].flatMap((viewport) =>
32563261
(['light', 'dark'] as const).map((theme) => ({ persona, viewport, theme }))

0 commit comments

Comments
 (0)