From b6d039d2cf20660b50fea6b445b9de34e6b0ebd3 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 9 Sep 2023 14:44:31 +0200 Subject: [PATCH] test: deflake test-http-regr-gh-2928 The socket might take some time to connect. Call `parser.consume()` when the connection is established. Closes: https://github.com/nodejs/node/pull/49565 --- test/sequential/test-http-regr-gh-2928.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/sequential/test-http-regr-gh-2928.js b/test/sequential/test-http-regr-gh-2928.js index 149aaeb6e6e420..0967f3dda2a48b 100644 --- a/test/sequential/test-http-regr-gh-2928.js +++ b/test/sequential/test-http-regr-gh-2928.js @@ -39,7 +39,9 @@ function execAndClose() { throw e; }); - parser.consume(socket._handle); + socket.on('connect', function() { + parser.consume(socket._handle); + }); parser.onIncoming = function onIncoming() { process.stdout.write('+');