mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
6963a93d0e
Due to extensive reliance on timings and the fs module, this test is currently inherently flaky. Refactor it to simply use setImmediate and only one busy loop. PR-URL: https://github.com/nodejs/node/pull/18567 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
19 lines
337 B
JavaScript
19 lines
337 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
let called = false;
|
|
const t1 = setInterval(() => {
|
|
assert(!called);
|
|
called = true;
|
|
setImmediate(common.mustCall(() => {
|
|
clearInterval(t1);
|
|
clearInterval(t2);
|
|
}));
|
|
}, 10);
|
|
|
|
const t2 = setInterval(() => {
|
|
common.busyLoop(20);
|
|
}, 10);
|