11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst cluster = require('cluster'); 51cb0ef41Sopenharmony_ciconst tmpdir = require('../common/tmpdir'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciif (cluster.isPrimary) { 81cb0ef41Sopenharmony_ci tmpdir.refresh(); 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ci assert.strictEqual(cluster.settings.cwd, undefined); 111cb0ef41Sopenharmony_ci cluster.fork().on('message', common.mustCall((msg) => { 121cb0ef41Sopenharmony_ci assert.strictEqual(msg, process.cwd()); 131cb0ef41Sopenharmony_ci })); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci cluster.setupPrimary({ cwd: tmpdir.path }); 161cb0ef41Sopenharmony_ci assert.strictEqual(cluster.settings.cwd, tmpdir.path); 171cb0ef41Sopenharmony_ci cluster.fork().on('message', common.mustCall((msg) => { 181cb0ef41Sopenharmony_ci assert.strictEqual(msg, tmpdir.path); 191cb0ef41Sopenharmony_ci })); 201cb0ef41Sopenharmony_ci} else { 211cb0ef41Sopenharmony_ci process.send(process.cwd()); 221cb0ef41Sopenharmony_ci process.disconnect(); 231cb0ef41Sopenharmony_ci} 24