Skip to content

Commit 17a77e1

Browse files
test(ui): settle before asserting exactly-once sessions.create
Reorders the exactly-once sessions.create assertion to run after the canonical navigation-settle poll (the same signal the neighboring submission test waits on), instead of right after waitForRequest resolves. The old order could pass prematurely if a late duplicate create landed after the count check but before navigation completed.
1 parent 3940711 commit 17a77e1

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎ui/src/e2e/new-session-page.places.e2e.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@ suite.define(() => {
8080
agentId: "main",
8181
message: "fix the flaky draft test",
8282
});
83-
expect(await gateway.getRequests("sessions.create")).toHaveLength(1);
83+
84+
// Wait for the same canonical settle signal the neighboring submission
85+
// test uses (navigation to the created session route) before counting
86+
// requests: the exactly-once assert must observe the submission flow
87+
// after it has fully resolved, not mid-flight, or a late duplicate
88+
// sessions.create could land after a premature pass.
8489
await expect
8590
.poll(() => new URL(page.url()).pathname)
8691
.toBe(controlUiSessionPath("agent:main:draft-e2e"));
92+
expect(await gateway.getRequests("sessions.create")).toHaveLength(1);
8793
} finally {
8894
await context.close();
8995
}

0 commit comments

Comments
 (0)