1'use strict'; 2 3const common = require('../common'); 4const initHooks = require('./init-hooks'); 5const verifyGraph = require('./verify-graph'); 6const spawn = require('child_process').spawn; 7 8const hooks = initHooks(); 9 10hooks.enable(); 11const sleep = spawn('sleep', [ '0.1' ]); 12 13sleep 14 .on('exit', common.mustCall(onsleepExit)) 15 .on('close', common.mustCall(onsleepClose)); 16 17function onsleepExit() {} 18 19function onsleepClose() {} 20 21process.on('exit', onexit); 22 23function onexit() { 24 hooks.disable(); 25 verifyGraph( 26 hooks, 27 [ { type: 'PROCESSWRAP', id: 'process:1', triggerAsyncId: null }, 28 { type: 'PIPEWRAP', id: 'pipe:1', triggerAsyncId: null }, 29 { type: 'PIPEWRAP', id: 'pipe:2', triggerAsyncId: null }, 30 { type: 'PIPEWRAP', id: 'pipe:3', triggerAsyncId: null } ], 31 ); 32} 33