Lines Matching refs:worker
23 // test-cluster-worker-exit.js
27 // - the worker.exitedAfterDisconnect flag, and worker.state are correct
28 // - the worker process actually goes away
52 worker_emitDisconnect: [1, "the worker did not emit 'disconnect'"],
53 worker_emitExit: [1, "the worker did not emit 'exit'"],
54 worker_state: ['disconnected', 'the worker state is incorrect'],
58 worker_died: [true, 'the worker is still running'],
59 worker_exitCode: [EXIT_CODE, 'the worker exited w/ incorrect exitCode'],
60 worker_signalCode: [null, 'the worker exited w/ incorrect signalCode']
70 // start worker
71 const worker = cluster.fork();
77 cluster.on('exit', common.mustCall((worker) => {
78 results.cluster_exitCode = worker.process.exitCode;
79 results.cluster_signalCode = worker.process.signalCode;
83 // Check worker events and properties
84 worker.on('disconnect', common.mustCall(() => {
86 results.worker_exitedAfterDisconnect = worker.exitedAfterDisconnect;
87 results.worker_state = worker.state;
93 // Check that the worker died
94 worker.once('exit', common.mustCall((exitCode, signalCode) => {
98 results.worker_died = !common.isAlive(worker.process.pid);