Skip to content

Commit 8133d70

Browse files
author
Meli
committed
test(desktop): wait for relay connect before restart-close check
The service-restart backoff test waited for the channel list to paint before firing the 1012 close. The channel list is Tauri-backed and renders before the websocket is up, so with three rejected dials the session was still in its backoff loop when the test looked for a socket to close and found none. Now that preconnect dials immediately instead of waiting for requestIdleCallback, the first rejected attempt happens early enough to expose the gap deterministically. Wait for the connected state instead. The test still fails with the 1012 backoff reset disabled, so it guards the same behavior. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
1 parent bcfe04e commit 8133d70

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎desktop/tests/e2e/relay-reconnect.spec.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,16 @@ test("service restart close resets accumulated backoff", async ({ page }) => {
368368
websocketConnectErrors: ["down 1", "down 2", "down 3"],
369369
});
370370
await page.goto("/");
371-
await expect(page.getByTestId("channel-general")).toBeVisible({
372-
timeout: 15_000,
373-
});
371+
// Three rejected dials put the session deep in its backoff loop before it
372+
// connects; wait for that connect rather than for the Tauri-backed channel
373+
// list, which paints long before the websocket is up.
374+
await expect
375+
.poll(
376+
() =>
377+
page.evaluate(() => window.__BUZZ_E2E_GET_RELAY_CONNECTION_STATE__?.()),
378+
{ timeout: 15_000 },
379+
)
380+
.toBe("connected");
374381

375382
const startedAt = Date.now();
376383
await restartMockWebsockets(page);

0 commit comments

Comments
 (0)