Skip to content

Commit

Permalink
Added test for setting scheduling policy with cluster.setPrimary()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfernandez committed Aug 20, 2023
1 parent 36d4de7 commit 23a309a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/known_issues/test-cluster-import-scheduling-policy.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Refs: https://github.com/nodejs/node/issues/49240
// When importing cluster in ESM, cluster.schedulingPolicy cannot be set;
// and the env variable doesn't work since imports are hoisted to the top.
import '../common/index.mjs';
import assert from 'node:assert';
import * as cluster from 'cluster';


assert.strictEqual(cluster.schedulingPolicy, cluster.SCHED_RR);
cluster.setupPrimary({ schedulingPolicy: cluster.SCHED_NONE });
const settings = cluster.getSettings();
assert.strictEqual(settings.schedulingPolicy, cluster.SCHED_NONE);

0 comments on commit 23a309a

Please sign in to comment.