mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: make test-http2-client-jsstream-destroy.js reliable
Use events instead of setTimeout() calls. Fixes: https://github.com/nodejs/node/issues/36078 PR-URL: https://github.com/nodejs/node/pull/36129 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
1 parent
0027aca332
commit
fff25a0714
1 file changed
+7
-4
@@ -46,10 +46,13 @@ server.listen(0, common.mustCall(function() {
|
||||
});
|
||||
const req = client.request();
|
||||
|
||||
setTimeout(() => socket.destroy(), common.platformTimeout(100));
|
||||
setTimeout(() => client.close(), common.platformTimeout(200));
|
||||
setTimeout(() => server.close(), common.platformTimeout(300));
|
||||
server.on('request', () => {
|
||||
socket.destroy();
|
||||
});
|
||||
|
||||
req.on('close', common.mustCall(() => { }));
|
||||
req.on('close', common.mustCall(() => {
|
||||
client.close();
|
||||
server.close();
|
||||
}));
|
||||
});
|
||||
}));
|
||||
Reference in new issue
Block a user