Skip to content

Commit 92a90eb

Browse files
test(site): fix terminal page test flakiness (#9798)
1 parent 1cd0bea commit 92a90eb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

site/src/pages/TerminalPage/TerminalPage.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const expectTerminalText = (container: HTMLElement, text: string) => {
5858
}
5959
expect(row.textContent).toContain(text);
6060
},
61-
{ timeout: 3_000 },
61+
{ timeout: 5_000 },
6262
);
6363
};
6464

@@ -67,6 +67,9 @@ describe("TerminalPage", () => {
6767
const spy = jest
6868
.spyOn(API, "getWorkspaceByOwnerAndName")
6969
.mockResolvedValue(MockWorkspace);
70+
const ws = new WS(
71+
`ws://localhost/api/v2/workspaceagents/${MockWorkspaceAgent.id}/pty`,
72+
);
7073
await renderTerminal(
7174
`/${MockUser.username}/${MockWorkspace.name}/terminal`,
7275
);
@@ -77,6 +80,7 @@ describe("TerminalPage", () => {
7780
);
7881
});
7982
spy.mockRestore();
83+
ws.close();
8084
});
8185

8286
it("shows an error if fetching workspace fails", async () => {

0 commit comments

Comments
 (0)