Skip to content

Commit

Permalink
test: covering destroying when worker already disconnected
Browse files Browse the repository at this point in the history
This test covers 374 line in lib/internal/cluster/master
that was uncovered by previous tests

PR-URL: #27896
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Keroosha authored and targos committed Jun 2, 2019
1 parent c683cd9 commit 9229825
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-cluster-call-and-destroy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';
const common = require('../common');
const cluster = require('cluster');
const assert = require('assert');

if (cluster.isMaster) {
const worker = cluster.fork();
worker.on('disconnect', common.mustCall(() => {
assert.strictEqual(worker.isConnected(), false);
worker.destroy();
}));
} else {
assert.strictEqual(cluster.worker.isConnected(), true);
cluster.worker.disconnect();
}

0 comments on commit 9229825

Please sign in to comment.