File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ if (!common.isMainThread)
1212 common . skip ( 'Setting the process title from Workers is not supported' ) ;
1313
1414const assert = require ( 'assert' ) ;
15- const exec = require ( 'child_process' ) . exec ;
15+ const { exec, execSync } = require ( 'child_process' ) ;
1616const path = require ( 'path' ) ;
1717
1818// The title shouldn't be too long; libuv's uv_set_process_title() out of
@@ -28,6 +28,15 @@ assert.strictEqual(process.title, title);
2828if ( common . isWindows )
2929 common . skip ( 'Windows does not have "ps" utility' ) ;
3030
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+
3140// To pass this test on alpine, since Busybox `ps` does not
3241// support `-p` switch, use `ps -o` and `grep` instead.
3342const cmd = common . isLinux ?
You can’t perform that action at this time.
0 commit comments