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

3 files changed

+3
-3
lines changed

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

+1-1
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

+1-1
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

+1-1
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)