diff --git a/test/parallel/test-cluster-call-and-destroy.js b/test/parallel/test-cluster-call-and-destroy.js new file mode 100644 index 00000000000000..76b5c73d9797c7 --- /dev/null +++ b/test/parallel/test-cluster-call-and-destroy.js @@ -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(); +}