mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: avoid deadlock issue in pipeline http2 tests to fix flakiness
This does not solve the remaining underlying deadlock issue, but does bound the test behaviour in a way that seems to avoid failures in practice. Deadlock fix to come separately later. Co-authored-by: Filip Skokan <panva.ip@gmail.com> Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65079 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
This commit is contained in:
1 parent
7074ae30fa
commit
59d7e22a12
1 file changed
+5
-3
@@ -27,10 +27,12 @@ const http2 = require('http2');
|
||||
client.close();
|
||||
}));
|
||||
|
||||
let cnt = 10;
|
||||
let received = 0;
|
||||
req.on('data', (data) => {
|
||||
cnt--;
|
||||
if (cnt === 0) rs.destroy();
|
||||
received += data.length;
|
||||
// Bound the data that flows before teardown - bytes per data event vary
|
||||
// by platform, and letting this run longer hangs on macOS.
|
||||
if (received >= 32 * 1024) rs.destroy();
|
||||
});
|
||||
}));
|
||||
}
|
||||
Reference in new issue
Block a user