1
0
Fork 0
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:
Yoshiya Hinosawa 2021-12-08 02:50:35 +09:00 committed by GitHub
parent 9e87ac9e0e
commit 5c0636888c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() {