0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/parallel/test-timers-setimmediate-infinite-loop.js
Ujjwal Sharma d54e0f8e52 test: rename regression tests file names
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the tests conform to the
standard test structure.

- Rename test-regress-GH-io-1068 to test-tty-stdin-end
- Rename test-regress-GH-io-1811 to test-zlib-kmaxlength-rangeerror
- Rename test-regress-GH-node-9326 to test-kill-segfault-freebsd
- Rename test-timers-regress-GH-9765 to test-timers-setimmediate-infinite-loop
- Rename test-tls-pfx-gh-5100-regr to test-tls-pfx-authorizationerror
- Rename test-tls-regr-gh-5108 to test-tls-tlswrap-segfault

PR-URL: https://github.com/nodejs/node/pull/19332
Fixes: https://github.com/nodejs/node/issues/19105
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-03-18 18:55:09 +01:00

20 lines
498 B
JavaScript

'use strict';
const common = require('../common');
// This test ensures that if an Immediate callback clears subsequent
// immediates we don't get stuck in an infinite loop.
//
// If the process does get stuck, it will be timed out by the test
// runner.
//
// Ref: https://github.com/nodejs/node/issues/9756
setImmediate(common.mustCall(function() {
clearImmediate(i2);
clearImmediate(i3);
}));
const i2 = setImmediate(common.mustNotCall());
const i3 = setImmediate(common.mustNotCall());