Skip to content

Commit f23010d

Browse files
panvaaduh95
authored andcommitted
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: #47836 Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Claude, Codex PR-URL: #66320 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 3f51c49 commit f23010d

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎test/es-module/es-module.status‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ prefix es-module
66

77
[true] # This section applies to all platforms
88

9-
[$system==linux || $system==freebsd]
10-
# https://github.com/nodejs/node/issues/47836
11-
test-esm-loader-http-imports: PASS,FLAKY
12-
139
[$arch==arm || $arch==arm64]
1410
# https://github.com/nodejs/node/issues/47297
1511
test-wasm-web-api: SKIP

‎test/es-module/test-esm-loader-http-imports.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const requestListener = ({ url }, rsp) => {
3434
.end();
3535
};
3636

37-
const server = http.createServer(requestListener);
37+
// Leave closing idle connections to the client, so that the loader never
38+
// reuses a keep-alive socket the server has just closed.
39+
const server = http.createServer({ keepAliveTimeout: 0 }, requestListener);
3840

3941
await promisify(server.listen.bind(server))({
4042
host: '127.0.0.1',

0 commit comments

Comments
 (0)