Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions examples/system-test/tests/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ async function run() {
},
...(BUILD_NAME === "ws-container"
? {
resources: {
cpu: 100,
memory: 100,
},
}
resources: {
cpu: 100,
memory: 100,
},
}
: {}),
},
});
Expand Down Expand Up @@ -128,8 +128,14 @@ async function run() {
ws.send(JSON.stringify(["ping", 123]));
};

ws.onclose = () => {
console.log("WebSocket connection closed");
ws.onclose = (ev) => {
if (ev.wasClean) {
console.log("WebSocket connection closed");
} else {
reject(
`WebSocket did not close cleanly: ${ev.reason} ${ev.code}`,
);
}
};

ws.onerror = (err) => {
Expand Down
Loading