Lines Matching refs:worker
23 // test-cluster-worker-kill.js
27 // - the worker.exitedAfterDisconnect flag, and worker.state are correct
28 // - the worker process actually goes away
50 worker_emitDisconnect: [1, "the worker did not emit 'disconnect'"],
51 worker_emitExit: [1, "the worker did not emit 'exit'"],
52 worker_state: ['disconnected', 'the worker state is incorrect'],
54 worker_died: [true, 'the worker is still running'],
55 worker_exitCode: [null, 'the worker exited w/ incorrect exitCode'],
57 'the worker exited w/ incorrect signalCode']
67 // start worker
68 const worker = cluster.fork();
70 // When the worker is up and running, kill it
71 worker.once('listening', common.mustCall(() => {
72 worker.process.kill(KILL_SIGNAL);
80 cluster.on('exit', common.mustCall((worker) => {
81 results.cluster_exitCode = worker.process.exitCode;
82 results.cluster_signalCode = worker.process.signalCode;
86 // Check worker events and properties
87 worker.on('disconnect', common.mustCall(() => {
89 results.worker_exitedAfter = worker.exitedAfterDisconnect;
90 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);