1'use strict'; 2 3const common = require('../common'); 4const initHooks = require('./init-hooks'); 5const verifyGraph = require('./verify-graph'); 6 7const net = require('net'); 8 9const tmpdir = require('../common/tmpdir'); 10tmpdir.refresh(); 11 12const hooks = initHooks(); 13hooks.enable(); 14 15const server = net.createServer((c) => { 16 c.end(); 17 server.close(); 18}).listen(common.PIPE, common.mustCall(onlisten)); 19 20function onlisten() { 21 net.connect(common.PIPE, common.mustCall(onconnect)); 22} 23 24function onconnect() {} 25 26process.on('exit', onexit); 27 28function onexit() { 29 hooks.disable(); 30 verifyGraph( 31 hooks, 32 [ { type: 'PIPESERVERWRAP', id: 'pipeserver:1', triggerAsyncId: null }, 33 { type: 'PIPEWRAP', id: 'pipe:1', triggerAsyncId: 'pipeserver:1' }, 34 { type: 'PIPECONNECTWRAP', id: 'pipeconnect:1', 35 triggerAsyncId: 'pipe:1' }, 36 { type: 'PIPEWRAP', id: 'pipe:2', triggerAsyncId: 'pipeserver:1' }, 37 { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'pipe:2' } ], 38 ); 39} 40