Skip to content

Commit 4af4b7e

Browse files
hi-ogawaOpenCode
andcommitted
test: bound Chromium benchmark waits
Co-authored-by: OpenCode <noreply@opencode.ai>
1 parent ec16156 commit 4af4b7e

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

packages/app/benchmark/e2e/benchmark.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const expectedDuration = process.env.BENCHMARK_DURATION ?? "30.00";
1414
const output = process.env.BENCHMARK_OUTPUT ?? "web";
1515
const warmupRuns = readCount("BENCHMARK_WARMUP_RUNS", 1);
1616
const measuredRuns = readCount("BENCHMARK_MEASURED_RUNS", 3);
17+
const runs = warmupRuns + measuredRuns;
18+
const runTimeout = Math.max(15_000, Number(expectedDuration) * 3_000);
19+
20+
test.setTimeout(runs * runTimeout + 15_000);
1721

1822
test("benchmarks Chromium WASM inference", async ({ page }) => {
1923
for (const path of [model, dft, fixture]) {
@@ -27,15 +31,11 @@ test("benchmarks Chromium WASM inference", async ({ page }) => {
2731
`Decoded: ${expectedDuration}s`,
2832
);
2933

30-
for (let index = 0; index < warmupRuns + measuredRuns; index++) {
34+
const runButton = page.locator("#run");
35+
for (let index = 0; index < runs; index++) {
3136
await page.evaluate(() => delete window.__demucsBenchmarkResult);
32-
await page.click("#run");
33-
await page.waitForFunction(
34-
() => window.__demucsBenchmarkResult !== undefined,
35-
{
36-
timeout: 15 * 60_000,
37-
},
38-
);
37+
await runButton.click();
38+
await expect(runButton).toBeEnabled({ timeout: runTimeout });
3939
const result = await page.evaluate(() => window.__demucsBenchmarkResult!);
4040
await writeFile(
4141
resolve(root, `data/benchmark/${output}-run-${index}.json`),

packages/app/benchmark/playwright.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import { defineConfig, devices } from "@playwright/test";
22

33
export default defineConfig({
44
testDir: "./e2e",
5-
fullyParallel: false,
65
workers: 1,
7-
retries: 0,
86
reporter: "list",
9-
timeout: 60 * 60_000,
107
use: { baseURL: "http://localhost:5199" },
118
webServer: {
129
command: "pnpm dev --port 5199 --strictPort",

0 commit comments

Comments
 (0)