Skip to content

Commit 235311b

Browse files
test: wait for the client to give up on a name that never resolves
How long a machine takes to say a name does not resolve is its own, and the page was idle before the answer came on one runner, so the snapshot was taken of "Hey." alone. The test now waits for the message that ends the sequence it records. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
1 parent f0466ec commit 235311b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎test/e2e/web-socket-server-url.test.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Server from "../../lib/Server.js";
77
import config from "../fixtures/client-config/webpack.config.js";
88
import runBrowser from "../helpers/run-browser.js";
99
import sessionSubscribe from "../helpers/session-subscribe.js";
10+
import waitFor from "../helpers/wait-for.js";
1011
import portsMap from "../ports-map.js";
1112

1213
const [port1, port2] = portsMap["web-socket-server-url"];
@@ -2199,6 +2200,16 @@ describe("web socket server URL", () => {
21992200
waitUntil: "networkidle0",
22002201
});
22012202

2203+
// The name never resolves, and how long a machine takes to say so is
2204+
// its own: the page is idle before the answer comes. What the client
2205+
// says once it has given up on the first attempt is the end of what
2206+
// there is to record.
2207+
await waitFor(() =>
2208+
consoleMessages.some((message) =>
2209+
message.text().includes("Trying to reconnect"),
2210+
),
2211+
);
2212+
22022213
t.assert.snapshot(consoleMessages.map((message) => message.text()));
22032214
t.assert.snapshot(
22042215
pageErrors.map((pageError) =>

0 commit comments

Comments
 (0)