11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst initHooks = require('./init-hooks');
51cb0ef41Sopenharmony_ciconst verifyGraph = require('./verify-graph');
61cb0ef41Sopenharmony_ciconst spawn = require('child_process').spawn;
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst hooks = initHooks();
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_cihooks.enable();
111cb0ef41Sopenharmony_ciconst sleep = spawn('sleep', [ '0.1' ]);
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_cisleep
141cb0ef41Sopenharmony_ci  .on('exit', common.mustCall(onsleepExit))
151cb0ef41Sopenharmony_ci  .on('close', common.mustCall(onsleepClose));
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_cifunction onsleepExit() {}
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_cifunction onsleepClose() {}
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ciprocess.on('exit', onexit);
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_cifunction onexit() {
241cb0ef41Sopenharmony_ci  hooks.disable();
251cb0ef41Sopenharmony_ci  verifyGraph(
261cb0ef41Sopenharmony_ci    hooks,
271cb0ef41Sopenharmony_ci    [ { type: 'PROCESSWRAP', id: 'process:1', triggerAsyncId: null },
281cb0ef41Sopenharmony_ci      { type: 'PIPEWRAP', id: 'pipe:1', triggerAsyncId: null },
291cb0ef41Sopenharmony_ci      { type: 'PIPEWRAP', id: 'pipe:2', triggerAsyncId: null },
301cb0ef41Sopenharmony_ci      { type: 'PIPEWRAP', id: 'pipe:3', triggerAsyncId: null } ],
311cb0ef41Sopenharmony_ci  );
321cb0ef41Sopenharmony_ci}
33