1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -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);
socket.onmessage = (event) => socket.send(event.data);
const socketClosed = new Promise<void>((resolve) => {
socket.onclose = () => resolve();
});
event1.respondWith(response);
const event2 = await event2Promise;
assertStrictEquals(event2, null);
listener.close();
await socketClosed;
}
async function client() {