Lines Matching refs:worker
72 worker: {
92 const stateNames = Object.keys(checks.worker.states);
98 cluster.on(name, common.mustCall(function(/* worker */) {
104 checks.cluster.equal[name] = worker === arguments[0];
108 checks.worker.states[state] = (state === worker.state);
112 // Kill worker when listening
114 worker.kill();
117 // Kill process when worker is killed
120 // Create worker
121 const worker = cluster.fork();
122 assert.strictEqual(worker.id, 1);
123 assert(worker instanceof cluster.Worker,
124 'the worker is not a instance of the Worker constructor');
127 forEach(checks.worker.events, function(bool, name, index) {
128 worker.on(name, common.mustCall(function() {
130 checks.worker.events[name] = true;
133 checks.worker.equal[name] = (worker === this);
137 assert.strictEqual(arguments[0], worker.process.exitCode);
138 assert.strictEqual(arguments[1], worker.process.signalCode);
176 // Check worker states
177 forEach(checks.worker.states, (check, name) => {
179 `The worker state "${name}" was not set to true`);
182 // Check worker events
183 forEach(checks.worker.events, (check, name) => {
185 `The worker event "${name}" on the worker object did not fire`);
188 // Check worker event arguments
189 forEach(checks.worker.equal, (check, name) => {
191 `The worker event "${name}" did not emit with correct argument`);