MCPcopy Index your code
hub / github.com/nodejs/node / onexit

Function onexit

test/async-hooks/test-pipewrap.js:66–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64process.on('exit', onexit);
65
66function onexit() {
67 hooks.disable();
68 hooks.sanityCheck('PROCESSWRAP');
69 hooks.sanityCheck('PIPEWRAP');
70
71 checkInvocations(
72 processwrap,
73 { init: 1, before: 1, after: 1 },
74 'processwrap while in onsleepClose callback');
75
76 [ pipe1, pipe2, pipe3 ].forEach((x) => {
77 assert.strictEqual(x.type, 'PIPEWRAP');
78 assert.strictEqual(x.triggerAsyncId, 1);
79 });
80
81 const ioEvents = Math.min(pipe2.before.length, pipe2.after.length);
82 // 2 events without any IO and at least one more for the node version data.
83 // Usually it is just one event, but it can be more.
84 assert.ok(ioEvents >= 3, `at least 3 stdout io events, got ${ioEvents}`);
85
86 checkInvocations(pipe1, { init: 1, before: 1, after: 1 },
87 'pipe wrap when sleep.spawn was called');
88 checkInvocations(pipe2, { init: 1, before: ioEvents, after: ioEvents },
89 'pipe wrap when sleep.spawn was called');
90 checkInvocations(pipe3, { init: 1, before: 2, after: 2 },
91 'pipe wrap when sleep.spawn was called');
92}

Callers

nothing calls this directly

Calls 5

sanityCheckMethod · 0.80
forEachMethod · 0.65
disableMethod · 0.45
minMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…