mirror of
https://github.com/rookiestar28/ComfyUI-OpenClaw.git
synced 2026-08-14 00:48:07 +00:00
fix(tests): widen harness transient import retry window
This commit is contained in:
@@ -64,4 +64,31 @@ test.describe('OpenClaw Sidebar', () => {
|
||||
.poll(() => page.evaluate(() => window.__openclawTestLoadAttempts))
|
||||
.toBe(2);
|
||||
});
|
||||
|
||||
test('harness recovers from two transient openclaw entry fetch failures', async ({ page }) => {
|
||||
let remainingFailures = 2;
|
||||
|
||||
await page.route('**/web/openclaw.js?openclaw_harness_attempt=*', async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname !== '/web/openclaw.js') {
|
||||
await route.fallback();
|
||||
return;
|
||||
}
|
||||
|
||||
if (remainingFailures > 0) {
|
||||
remainingFailures -= 1;
|
||||
await route.abort('failed');
|
||||
return;
|
||||
}
|
||||
|
||||
await route.fallback();
|
||||
});
|
||||
|
||||
await page.reload();
|
||||
await waitForOpenClawReady(page);
|
||||
await expect(page.locator('.openclaw-title')).toHaveText('OpenClaw');
|
||||
await expect
|
||||
.poll(() => page.evaluate(() => window.__openclawTestLoadAttempts))
|
||||
.toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
|
||||
async function loadOpenClawWithRetry() {
|
||||
const maxAttempts = 2;
|
||||
const maxAttempts = 3;
|
||||
let lastError = null;
|
||||
|
||||
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
||||
@@ -93,10 +93,11 @@
|
||||
throw error;
|
||||
}
|
||||
|
||||
// IMPORTANT: retry exactly once for transient module-fetch failures.
|
||||
// Windows CI can occasionally drop the first module-graph fetch under
|
||||
// parallel Playwright load; do not broaden this to mask real import bugs.
|
||||
await new Promise(r => setTimeout(r, 250));
|
||||
// IMPORTANT: keep this retry window small and transient-fetch-specific.
|
||||
// Windows CI can occasionally drop more than one early module-graph
|
||||
// fetch under parallel Playwright load, but broad retries here would
|
||||
// risk masking real import/runtime regressions.
|
||||
await new Promise(r => setTimeout(r, 250 * attempt));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user