forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for setting scheduling policy with cluster.setPrimary()
- Loading branch information
1 parent
36d4de7
commit 23a309a
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
test/known_issues/test-cluster-import-scheduling-policy.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |