diff --git a/node/node-4-tests.ts b/node/node-4-tests.ts index 5a25f1fa20..4afa9da584 100644 --- a/node/node-4-tests.ts +++ b/node/node-4-tests.ts @@ -724,13 +724,17 @@ childProcess.spawnSync("echo test"); /// cluster tests: https://nodejs.org/api/cluster.html /// ////////////////////////////////////////////////////////////////////// -cluster.fork(); -Object.keys(cluster.workers).forEach(key => { - const worker = cluster.workers[key]; - if (worker.isDead()) { - console.log('worker %d is dead', worker.process.pid); +namespace cluster_tests { + { + cluster.fork(); + Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } + }); } -}); +} //////////////////////////////////////////////////// /// os tests : https://nodejs.org/api/os.html