Skip to content

Commit

Permalink
benchmark,test: use cluster.isPrimary instead of cluster.isMaster
Browse files Browse the repository at this point in the history
`cluster.isMaster` was deprecated. So need to use `cluster.isPrimary`
for benchmark and test.

Refs: #47981
  • Loading branch information
deokjinkim committed May 14, 2023
1 parent abb1c45 commit 7fa0309
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion benchmark/cluster/echo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const cluster = require('cluster');
if (cluster.isMaster) {
if (cluster.isPrimary) {
const common = require('../common.js');
const bench = common.createBenchmark(main, {
workers: [1],
Expand Down
2 changes: 1 addition & 1 deletion benchmark/http/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const PORT = common.PORT;

const cluster = require('cluster');
let bench;
if (cluster.isMaster) {
if (cluster.isPrimary) {
bench = common.createBenchmark(main, {
// Unicode confuses ab on os x.
type: ['bytes', 'buffer'],
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-child-index-dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function child() {
}
}

if (cluster.isMaster)
if (cluster.isPrimary)
cluster.fork(__filename);
else
child();
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-child-index-net.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function child() {
}
}

if (cluster.isMaster)
if (cluster.isPrimary)
cluster.fork(__filename);
else
child();
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-net-listen-backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cluster.schedulingPolicy = cluster.SCHED_RR;

// Ensures that the `backlog` is used to create a `net.Server`.
const kExpectedBacklog = 127;
if (cluster.isMaster) {
if (cluster.isPrimary) {
const listen = net.Server.prototype.listen;

net.Server.prototype.listen = common.mustCall(
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-kill-signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (cluster.isWorker) {
server.once('listening', common.mustCall());
server.listen(0, '127.0.0.1');

} else if (cluster.isMaster) {
} else if (cluster.isPrimary) {
const KILL_SIGNAL = 'SIGKILL';

// Start worker
Expand Down

0 comments on commit 7fa0309

Please sign in to comment.