test: deflake esm loader http imports

Keep idle server connections open until the client closes them. This
avoids reusing a keep-alive socket the server closed while the loader
thread was stalled.

Refs: https://github.com/nodejs/node/issues/47836
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Claude, Codex
PR-URL: https://github.com/nodejs/node/pull/66320
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Filip Skokan authored and Antoine du Hamel committed 2026-10-03 17:30:23 +02:00
1 parent 3f51c49ff9
commit f23010d837
2 files changed
+3 -5

No files matched your search

-4
View File
@@ -6,10 +6,6 @@ prefix es-module
[true] # This section applies to all platforms
[$system==linux || $system==freebsd]
# https://github.com/nodejs/node/issues/47836
test-esm-loader-http-imports: PASS,FLAKY
[$arch==arm || $arch==arm64]
# https://github.com/nodejs/node/issues/47297
test-wasm-web-api: SKIP
@@ -34,7 +34,9 @@ const requestListener = ({ url }, rsp) => {
.end();
};
const server = http.createServer(requestListener);
// Leave closing idle connections to the client, so that the loader never
// reuses a keep-alive socket the server has just closed.
const server = http.createServer({ keepAliveTimeout: 0 }, requestListener);
await promisify(server.listen.bind(server))({
host: '127.0.0.1',