We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71f456c commit a97c048Copy full SHA for a97c048
test/known_issues/test-cluster-import-scheduling-policy.mjs
@@ -0,0 +1,12 @@
1
+// Refs: https://github.com/nodejs/node/issues/49240
2
+// When importing cluster in ESM, cluster.schedulingPolicy cannot be set;
3
+// and the env variable doesn't work since imports are hoisted to the top.
4
+import '../common/index.mjs';
5
+import assert from 'node:assert';
6
+import * as cluster from 'cluster';
7
+
8
9
+assert.strictEqual(cluster.schedulingPolicy, cluster.SCHED_RR);
10
+cluster.setupPrimary({ schedulingPolicy: cluster.SCHED_NONE });
11
+const settings = cluster.getSettings();
12
+assert.strictEqual(settings.schedulingPolicy, cluster.SCHED_NONE);
0 commit comments