summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-server-request-timeout-upgrade.js
diff options
context:
space:
mode:
authorPaolo Insogna <paolo@cowtech.it>2022-04-13 16:47:59 +0200
committerGitHub <noreply@github.com>2022-04-13 15:47:59 +0100
commit3caa2c1a005652fdb3e896ef940cd5ffe5fdff10 (patch)
treef8e9e9bfe7c95d5633c86e021518f487a9eadb8f /test/parallel/test-http-server-request-timeout-upgrade.js
parent9d6af7d1fe66afdcb781fb5bad37b4cb4d396f0e (diff)
downloadnode-new-3caa2c1a005652fdb3e896ef940cd5ffe5fdff10.tar.gz
http: refactor headersTimeout and requestTimeout logic
PR-URL: https://github.com/nodejs/node/pull/41263 Fixes: https://github.com/nodejs/node/issues/33440 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'test/parallel/test-http-server-request-timeout-upgrade.js')
-rw-r--r--test/parallel/test-http-server-request-timeout-upgrade.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/parallel/test-http-server-request-timeout-upgrade.js b/test/parallel/test-http-server-request-timeout-upgrade.js
index 87e8dbab13..b1974a128b 100644
--- a/test/parallel/test-http-server-request-timeout-upgrade.js
+++ b/test/parallel/test-http-server-request-timeout-upgrade.js
@@ -8,16 +8,18 @@ const { connect } = require('net');
// This test validates that the requestTimeoout
// is disabled after the connection is upgraded.
let sendDelayedRequestHeaders;
-const server = createServer(common.mustNotCall());
+const requestTimeout = common.platformTimeout(1000);
+const server = createServer({
+ headersTimeout: 0,
+ requestTimeout,
+ keepAliveTimeout: 0,
+ connectionsCheckingInterval: common.platformTimeout(250),
+}, common.mustNotCall());
server.on('connection', common.mustCall(() => {
assert.strictEqual(typeof sendDelayedRequestHeaders, 'function');
sendDelayedRequestHeaders();
}));
-// 0 seconds is the default
-assert.strictEqual(server.requestTimeout, 0);
-const requestTimeout = common.platformTimeout(1000);
-server.requestTimeout = requestTimeout;
assert.strictEqual(server.requestTimeout, requestTimeout);
server.on('upgrade', common.mustCall((req, socket, head) => {