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.
This commit is contained in:
Neil
2026-10-26 07:52:20 -07:00
committed by GitHub
parent c3bbd6fd67
commit c1d3031bcd
+5 -5
View File
@@ -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(() => {