From 59d7e22a129dd1685ad2bb3adeae58e62ed73c52 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Sun, 9 Aug 2026 22:38:43 +0200 Subject: [PATCH] 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 Signed-off-by: Tim Perry PR-URL: https://github.com/nodejs/node/pull/65079 Reviewed-By: Yagiz Nizipli Reviewed-By: Matteo Collina Reviewed-By: Filip Skokan --- test/parallel/test-stream-pipeline-http2.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-stream-pipeline-http2.js b/test/parallel/test-stream-pipeline-http2.js index c35cd696bd1..8ffee778683 100644 --- a/test/parallel/test-stream-pipeline-http2.js +++ b/test/parallel/test-stream-pipeline-http2.js @@ -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(); }); })); }