mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 03:44:05 -05:00
fix(ext/timers): fix flakiness of httpConnAutoCloseDelayedOnUpgrade
test (#13017)
This commit is contained in:
parent
9e87ac9e0e
commit
5c0636888c
1 changed files with 4 additions and 0 deletions
|
@ -1055,12 +1055,16 @@ Deno.test(
|
||||||
|
|
||||||
const { socket, response } = Deno.upgradeWebSocket(event1.request);
|
const { socket, response } = Deno.upgradeWebSocket(event1.request);
|
||||||
socket.onmessage = (event) => socket.send(event.data);
|
socket.onmessage = (event) => socket.send(event.data);
|
||||||
|
const socketClosed = new Promise<void>((resolve) => {
|
||||||
|
socket.onclose = () => resolve();
|
||||||
|
});
|
||||||
event1.respondWith(response);
|
event1.respondWith(response);
|
||||||
|
|
||||||
const event2 = await event2Promise;
|
const event2 = await event2Promise;
|
||||||
assertStrictEquals(event2, null);
|
assertStrictEquals(event2, null);
|
||||||
|
|
||||||
listener.close();
|
listener.close();
|
||||||
|
await socketClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function client() {
|
async function client() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue