2016-11-22 17:13:44 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
const initHooks = require('./init-hooks');
|
|
|
|
const verifyGraph = require('./verify-graph');
|
|
|
|
const TIMEOUT = 1;
|
|
|
|
|
|
|
|
const hooks = initHooks();
|
|
|
|
hooks.enable();
|
|
|
|
|
|
|
|
setTimeout(common.mustCall(ontimeout), TIMEOUT);
|
|
|
|
function ontimeout() {
|
|
|
|
setTimeout(onsecondTimeout, TIMEOUT + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onsecondTimeout() {
|
|
|
|
setTimeout(onthirdTimeout, TIMEOUT + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
function onthirdTimeout() {}
|
|
|
|
|
|
|
|
process.on('exit', onexit);
|
|
|
|
|
|
|
|
function onexit() {
|
|
|
|
hooks.disable();
|
|
|
|
verifyGraph(
|
|
|
|
hooks,
|
2017-06-14 12:39:53 +02:00
|
|
|
[ { type: 'Timeout', id: 'timeout:1', triggerAsyncId: null },
|
|
|
|
{ type: 'TIMERWRAP', id: 'timer:1', triggerAsyncId: null },
|
|
|
|
{ type: 'Timeout', id: 'timeout:2', triggerAsyncId: 'timeout:1' },
|
|
|
|
{ type: 'TIMERWRAP', id: 'timer:2', triggerAsyncId: 'timeout:1' },
|
|
|
|
{ type: 'Timeout', id: 'timeout:3', triggerAsyncId: 'timeout:2' },
|
|
|
|
{ type: 'TIMERWRAP', id: 'timer:3', triggerAsyncId: 'timeout:2' } ]
|
2016-11-22 17:13:44 +01:00
|
|
|
);
|
|
|
|
}
|