Skip to content

Commit c3571ed

Browse files
test(ui): freeze connect clock before page boot (#191379)
Pause virtual time before navigation and settle the first handshake explicitly. Cold boot wall time can no longer add uncontrolled attempts to the fixed retry observation window. Keep the existing denial, backoff, and recovery assertions. Allocate exactly six regression lines for the clock-controlled setup. Co-authored-by: steipete <[email protected]>
1 parent 9e7b56b commit c3571ed

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Start the connect-denial observation on a paused clock, including the first handshake.
2+
6

‎ui/src/e2e/gateway-connect-denial.e2e.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ suite.define(() => {
1515
async (failure) => {
1616
await suite.withPage({ viewport: { width: 1280, height: 900 } }, async ({ page }) => {
1717
await page.clock.install();
18+
await pauseVirtualClock(page);
1819
await page.route("**/healthz", (route) =>
1920
route.fulfill({ status: 200, json: { ok: true, status: "live" } }),
2021
);
@@ -33,10 +34,15 @@ suite.define(() => {
3334
},
3435
});
3536
await page.goto(suite.server.baseUrl);
36-
await gateway.waitForRequest("connect");
37+
// Mock socket timers and WebCrypto must settle without a wall-time boot window.
38+
await expect
39+
.poll(async () => {
40+
await page.clock.runFor(1);
41+
return (await gateway.getRequests("connect")).length;
42+
})
43+
.toBe(1);
3744
const gate = page.locator(".login-gate");
3845
await gate.waitFor();
39-
await pauseVirtualClock(page);
4046
const initialAttempts = (await gateway.getRequests("connect")).length;
4147
for (let second = 0; second < 60; second++) {
4248
await page.clock.runFor(1_000);

0 commit comments

Comments
 (0)