mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

This test can fail when run in parallel with test-process-title-cli,
which also sets the process title, which is global state on Windows.
Example failure (note that `foo` does not appear in test-process-title
but in test-process-title-cli):
not ok 1727 parallel/test-process-title
---
duration_ms: 0.156
severity: fail
exitcode: 1
stack: |-
assert.js:103
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 'foo'
- 'd:\\a\\node\\node\\out\\Release\\node.exe'
at Object.<anonymous> (d:\a\node\node\test\parallel\test-process-title.js:22:1)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: 'foo',
expected: 'd:\\a\\node\\node\\out\\Release\\node.exe',
operator: 'strictEqual'
}
...
(from 628144750
)
PR-URL: https://github.com/nodejs/node/pull/33150
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
22 lines
837 B
JavaScript
22 lines
837 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { spawnSync } = require('child_process');
|
|
const { strictEqual } = require('assert');
|
|
|
|
// FIXME add sunos support
|
|
if (common.isSunOS)
|
|
common.skip(`Unsupported platform [${process.platform}]`);
|
|
// FIXME add IBMi support
|
|
if (common.isIBMi)
|
|
common.skip('Unsupported platform IBMi');
|
|
|
|
// Explicitly assigning to process.title before starting the child process
|
|
// is necessary otherwise *its* process.title is whatever the last
|
|
// SetConsoleTitle() call in our process tree set it to.
|
|
// Can be removed when https://github.com/libuv/libuv/issues/2667 is fixed.
|
|
if (common.isWindows)
|
|
process.title = process.execPath;
|
|
|
|
const xs = 'x'.repeat(1024);
|
|
const proc = spawnSync(process.execPath, ['-p', 'process.title', xs]);
|
|
strictEqual(proc.stdout.toString().trim(), process.execPath);
|