Skip to content

Commit 0af15c7

Browse files
joyeecheungRafaelGSS
authored andcommitted
test: make the vm timeout escape tests more lenient
Previously the tests required that Node.js finish the initialization of the watchdog thread and fires the timeout within 100ms, which can be difficult on certain systems under load. This patch relaxes the requirement to 2000ms. If there is a bug and the timeout can actually be escaped, raising the timeout to 2000ms would not make a difference anyway. PR-URL: #44433 Refs: nodejs/reliability#333 Refs: nodejs/reliability#361 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
1 parent 0f071b8 commit 0af15c7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/parallel/test-vm-timeout-escape-promise-2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function loop() {
1616
while (1) {
1717
const current = hrtime();
1818
const span = (current - start) / NS_PER_MS;
19-
if (span >= 100n) {
19+
if (span >= 2000n) {
2020
throw new Error(
2121
`escaped timeout at ${span} milliseconds!`);
2222
}

test/parallel/test-vm-timeout-escape-promise-module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function loop() {
1818
while (1) {
1919
const current = hrtime();
2020
const span = (current - start) / NS_PER_MS;
21-
if (span >= 100n) {
21+
if (span >= 2000n) {
2222
throw new Error(
2323
`escaped timeout at ${span} milliseconds!`);
2424
}

test/parallel/test-vm-timeout-escape-promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function loop() {
1717
while (1) {
1818
const current = hrtime();
1919
const span = (current - start) / NS_PER_MS;
20-
if (span >= 100n) {
20+
if (span >= 2000n) {
2121
throw new Error(
2222
`escaped timeout at ${span} milliseconds!`);
2323
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy