Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(desktop): pace A/B chat opens under the control-api session limit

Alfredo Lopezfd7146157c60
diff --git a/desktop-app/test/e2e-playwright/chat-open-ab.spec.ts b/desktop-app/test/e2e-playwright/chat-open-ab.spec.ts
index ee11768f0..a5c37eee3 100644
--- a/desktop-app/test/e2e-playwright/chat-open-ab.spec.ts
+++ b/desktop-app/test/e2e-playwright/chat-open-ab.spec.ts
@@ -77,7 +77,14 @@ function isolatedPath(runDir: string, target: string): string {
throw new Error(`Cache target escapes isolation through a symlink: ${target}`)
return target
}
+// Each open sends about 8 REST requests, several of them counted by control-api's 120/min
+// per-session limit; spacing opens keeps a launch under that limit. The wait is outside the timing.
+const OPEN_PACE_MS = 4_000
+let lastOpenAt = 0
async function openChat(page: Page, host: string, label: string, chat: Chat): Promise<number> {
+ const pace = lastOpenAt + OPEN_PACE_MS - Date.now()
+ if (pace > 0) await page.waitForTimeout(pace)
+ lastOpenAt = Date.now()
await page
.getByRole('navigation', { name: 'Chat breadcrumb', exact: true })
.getByRole('button', { name: 'Chat', exact: true })
diff --git a/desktop-app/test/e2e-playwright/playwright.chat-open-ab.config.ts b/desktop-app/test/e2e-playwright/playwright.chat-open-ab.config.ts
index 5690f0d8a..c82fef83e 100644
--- a/desktop-app/test/e2e-playwright/playwright.chat-open-ab.config.ts
+++ b/desktop-app/test/e2e-playwright/playwright.chat-open-ab.config.ts
@@ -17,7 +17,8 @@ export default defineConfig({
...base,
globalSetup: undefined,
projects: [{ name: 'chat-open-ab', testMatch: /chat-open-ab\.spec\.ts/ }],
- timeout: 2_400_000,
+ // Paced opens, 65 s rate-limit windows between launches and stateless suspension waits.
+ timeout: 5_400_000,
expect: { timeout: 30_000 },
retries: 0,
workers: 1,