File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ if (!common.isMainThread)
12
12
common . skip ( 'Setting the process title from Workers is not supported' ) ;
13
13
14
14
const assert = require ( 'assert' ) ;
15
- const exec = require ( 'child_process' ) . exec ;
15
+ const { exec, execSync } = require ( 'child_process' ) ;
16
16
const path = require ( 'path' ) ;
17
17
18
18
// The title shouldn't be too long; libuv's uv_set_process_title() out of
@@ -28,6 +28,15 @@ assert.strictEqual(process.title, title);
28
28
if ( common . isWindows )
29
29
common . skip ( 'Windows does not have "ps" utility' ) ;
30
30
31
+ try {
32
+ execSync ( 'command -v ps' ) ;
33
+ } catch ( err ) {
34
+ if ( err . status === 1 ) {
35
+ common . skip ( 'The "ps" utility is not available' ) ;
36
+ }
37
+ throw err ;
38
+ }
39
+
31
40
// To pass this test on alpine, since Busybox `ps` does not
32
41
// support `-p` switch, use `ps -o` and `grep` instead.
33
42
const cmd = common . isLinux ?
You can’t perform that action at this time.
0 commit comments