mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: fix flaky cleanup in http2 test
Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65701 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
7a3437d998
commit
75a9fa65ac
1 file changed
+4
-2
@@ -38,6 +38,7 @@ class StalledClientSocket extends Duplex {
|
||||
super();
|
||||
this.inner = net.connect(port, common.localhostIPv4);
|
||||
this.inner.on('data', (chunk) => this.push(chunk));
|
||||
this.inner.on('end', () => this.push(null));
|
||||
}
|
||||
_read() {
|
||||
// Incoming data is pushed as it arrives.
|
||||
@@ -54,7 +55,7 @@ class StalledClientSocket extends Duplex {
|
||||
callback();
|
||||
}
|
||||
_final(callback) {
|
||||
callback();
|
||||
this.inner.end(callback);
|
||||
}
|
||||
_destroy(err, callback) {
|
||||
this.inner.destroy();
|
||||
@@ -101,7 +102,8 @@ server.listen(0, common.mustCall(() => {
|
||||
stallWrites = false;
|
||||
for (const callback of heldCallbacks) callback();
|
||||
|
||||
client.destroy();
|
||||
req.end();
|
||||
client.close();
|
||||
server.close();
|
||||
}));
|
||||
}));
|
||||
Reference in new issue
Block a user