diff --git a/test/known_issues/test-cluster-import-scheduling-policy.mjs b/test/known_issues/test-cluster-import-scheduling-policy.mjs new file mode 100644 index 00000000000000..2ad3ef313fa2a7 --- /dev/null +++ b/test/known_issues/test-cluster-import-scheduling-policy.mjs @@ -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);