Skip to content

Commit 1d2ca45

Browse files
committed
fix: use production build for e2e in CI; TFJS load times out under parallel dev server
1 parent 511a0ab commit 1d2ca45

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

e2e/poms/LabPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class LabPage {
3838
return this.page.locator('.words-button');
3939
}
4040

41-
async waitForTrainingScene(timeout = 15_000) {
41+
async waitForTrainingScene(timeout = 20_000) {
4242
await this.eraseButton.waitFor({state: 'visible', timeout});
4343
}
4444

playwright.config.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import {defineConfig, devices} from 'playwright/test';
22

33
export default defineConfig({
44
testDir: './e2e',
5-
fullyParallel: true,
5+
fullyParallel: false,
6+
// workers:1 keeps lab scene transitions stable; TFJS model load is timing-sensitive.
7+
workers: 1,
68
retries: process.env.CI ? 2 : 0,
9+
// 90 s per test — TFJS model (1.87 MB) + scene transitions can be slow in CI.
10+
timeout: 60_000,
711
reporter: 'html',
812
use: {
913
baseURL: 'http://localhost:5173/ai-literacy-oceans/',
1014
trace: 'on-first-retry',
11-
// Give the TFJS model time to load before assertions.
12-
actionTimeout: 15_000,
15+
actionTimeout: 20_000,
1316
},
1417
projects: [
1518
{
@@ -18,8 +21,14 @@ export default defineConfig({
1821
},
1922
],
2023
webServer: {
21-
command: 'pnpm dev',
24+
// Use the production build for e2e — pre-bundled assets avoid Vite's
25+
// per-request transform overhead, which caused TFJS model load timeouts
26+
// when multiple browser instances ran in parallel against the dev server.
27+
command: process.env.CI
28+
? 'pnpm build && pnpm preview'
29+
: 'pnpm dev',
2230
url: 'http://localhost:5173/ai-literacy-oceans/',
2331
reuseExistingServer: !process.env.CI,
32+
timeout: 120_000,
2433
},
2534
});

0 commit comments

Comments
 (0)