forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest-graph.pipe.js
More file actions
32 lines (24 loc) · 792 Bytes
/
test-graph.pipe.js
File metadata and controls
32 lines (24 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
const common = require('../common');
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const spawn = require('child_process').spawn;
const hooks = initHooks();
hooks.enable();
const sleep = spawn('sleep', [ '0.1' ]);
sleep
.on('exit', common.mustCall(onsleepExit))
.on('close', common.mustCall(onsleepClose));
function onsleepExit() {}
function onsleepClose() {}
process.on('exit', onexit);
function onexit() {
hooks.disable();
verifyGraph(
hooks,
[ { type: 'PROCESSWRAP', id: 'process:1', triggerAsyncId: null },
{ type: 'PIPEWRAP', id: 'pipe:1', triggerAsyncId: null },
{ type: 'PIPEWRAP', id: 'pipe:2', triggerAsyncId: null },
{ type: 'PIPEWRAP', id: 'pipe:3', triggerAsyncId: null } ]
);
}