Skip to content

Commit 1579d47

Browse files
committed
test(ui): give startup waits an explicit budget
1 parent 0d96f83 commit 1579d47

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎ui/src/app/bootstrap.test.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ import { bootstrapApplication } from "./bootstrap.ts";
1515
import type { ApplicationContext } from "./context.ts";
1616
import { loadSettings, saveSettings } from "./settings.ts";
1717

18+
// Startup progress (dynamic imports, gateway subscribe, router start) is not a
19+
// performance assertion, so these waits must not inherit vi.waitFor's 1s default:
20+
// under a loaded CI runner that budget expires before startup reaches the step.
21+
const STARTUP_STEP_WAIT = { timeout: 15_000 };
22+
1823
function deferred<T>() {
1924
let resolve!: (value: T) => void;
2025
const promise = new Promise<T>((resolvePromise) => {
@@ -366,7 +371,7 @@ describe("normalizeInitialApplicationLocation", () => {
366371
features: { methods: ["openclaw.setup.detect"] },
367372
},
368373
} as Parameters<GatewayListener>[0]);
369-
await vi.waitFor(() => expect(replaceRoute).toHaveBeenCalledOnce());
374+
await vi.waitFor(() => expect(replaceRoute).toHaveBeenCalledOnce(), STARTUP_STEP_WAIT);
370375
expect(replaceRoute).toHaveBeenCalledWith("model-setup", { search: "?firstRun=1" });
371376
});
372377

@@ -515,7 +520,7 @@ describe("normalizeInitialApplicationLocation", () => {
515520

516521
try {
517522
const start = runtime.start();
518-
await vi.waitFor(() => expect(activeSubscriptions.size).toBe(1));
523+
await vi.waitFor(() => expect(activeSubscriptions.size).toBe(1), STARTUP_STEP_WAIT);
519524
runtime.stop();
520525
await start;
521526

@@ -545,7 +550,7 @@ describe("normalizeInitialApplicationLocation", () => {
545550

546551
try {
547552
const start = runtime.start();
548-
await vi.waitFor(() => expect(routerStart).toHaveBeenCalledOnce());
553+
await vi.waitFor(() => expect(routerStart).toHaveBeenCalledOnce(), STARTUP_STEP_WAIT);
549554
runtime.stop();
550555
expect(routerStop).toHaveBeenCalledOnce();
551556

0 commit comments

Comments
 (0)