xref: /third_party/node/test/fixtures/cluster-preload.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/fixtures/
11cb0ef41Sopenharmony_ciconst assert = require('assert');
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ci// https://github.com/nodejs/node/issues/1803
41cb0ef41Sopenharmony_ci// this module is used as a preload module. It should have a parent with the
51cb0ef41Sopenharmony_ci// module search paths initialized from the current working directory
61cb0ef41Sopenharmony_ciassert.ok(module.parent);
71cb0ef41Sopenharmony_ciconst expectedPaths = require('module')._nodeModulePaths(process.cwd());
81cb0ef41Sopenharmony_ciassert.deepStrictEqual(module.parent.paths, expectedPaths);
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst cluster = require('cluster');
111cb0ef41Sopenharmony_cicluster.isPrimary || process.exit(42 + cluster.worker.id); // +42 to distinguish
121cb0ef41Sopenharmony_ci// from exit(1) for other random reasons
13

Indexes created Thu Nov 07 10:32:03 CST 2024