test: avoid idle HTTP/HTTPS connections

Single-use requests otherwise wait for the keep-alive timeout. Use
nonpersistent agents where agent selection is unrelated to coverage.
For default-agent tests, close the server after consuming the response.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Assisted-by: Codex
PR-URL: https://github.com/nodejs/node/pull/65980
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
This commit is contained in:
Filip Skokan authored and Antoine du Hamel committed 2026-09-16 21:12:14 +02:00
1 parent 6314ccf93b
commit 831ec42bcc
37 files changed
+45 -15

No files matched your search

@@ -32,6 +32,7 @@ const options = {
'https://example.com/testpath',
{
agent: false,
hostname: 'localhost',
port: server.address().port,
rejectUnauthorized: false