From c1d3031bcd71401ccad5014496a7d687101ca9c9 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 26 Oct 2026 07:52:20 -0700 Subject: [PATCH] test(e2e): wait for the catalog failure past a slow conversion (#33960) "reconnect restores the managed host name after its conversion catalog fails" started page.waitForEvent('console') before the reconnect that converts the host. Its 30 s clock ran through the conversion, so on a loaded machine or a slow host the test timed out even though the catalog failure was logged. It failed this way on unmodified main locally. With the Docker host frozen for 35 s during the reconnect it fails every time before this change and passes after it. The test now collects console messages and polls once the host is managed. It also drops a log line the app no longer prints. --- tests/e2e/ssh-orcad-auto-convert.spec.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/ssh-orcad-auto-convert.spec.ts b/tests/e2e/ssh-orcad-auto-convert.spec.ts index 12c9f9e57ca..6d97306ace0 100644 --- a/tests/e2e/ssh-orcad-auto-convert.spec.ts +++ b/tests/e2e/ssh-orcad-auto-convert.spec.ts @@ -440,15 +440,15 @@ test('reconnect restores the managed host name after its conversion catalog fail ipcMain.handle('runtimeEnvironments:list', original) } }) - const failure = page.waitForEvent('console', { - predicate: (message) => - message.text().includes('Could not refresh the managed server list') || - message.text().includes('Could not load the managed server catalogs') + // Collect rather than waitForEvent: its 30 s clock would start before the conversion below. + let catalogFailed = false + page.on('console', (message) => { + catalogFailed ||= message.text().includes('Could not load the managed server catalogs') }) cpSync(TEMPLATE_SOURCE!, templateDir, { recursive: true }) await reconnect(page, seeded.targetId) await expect.poll(() => managedServer(page, seeded.targetId)).toMatchObject({ kind: 'managed' }) - await failure + await expect.poll(() => catalogFailed).toBe(true) await page.screenshot({ path: testInfo.outputPath('catalog-failure.png') }) await app.evaluate(() => {