diff options
author | Rich Trott <rtrott@gmail.com> | 2019-01-15 07:27:55 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-01-17 16:13:04 -0800 |
commit | 5fdd55473047b8e4fca79dae42b9ca2d0d5b08ae (patch) | |
tree | 18f60f768c306e62dcfae92034d89a8de065c6f6 /test | |
parent | 098c2cc348da08b7092b434221ed2fcf607d8b0a (diff) | |
download | android-node-v8-5fdd55473047b8e4fca79dae42b9ca2d0d5b08ae.tar.gz android-node-v8-5fdd55473047b8e4fca79dae42b9ca2d0d5b08ae.tar.bz2 android-node-v8-5fdd55473047b8e4fca79dae42b9ca2d0d5b08ae.zip |
test: add check for wrk to test-keep-alive
test/pummel/test-keep-alive.js requires `wrk` to be installed. Check if
it is, and skip the test if it isn't.
This is yet another step in preparation for running pummel tests in CI
daily.
PR-URL: https://github.com/nodejs/node/pull/25516
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/pummel/test-keep-alive.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js index 5d2f00170d..896f0a1f68 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -23,11 +23,13 @@ // This test requires the program 'wrk'. const common = require('../common'); -if (common.isWindows) - common.skip('no `wrk` on windows'); + +const child_process = require('child_process'); +const result = child_process.spawnSync('wrk', ['-h']); +if (result.error && result.error.code === 'ENOENT') + common.skip('test requires `wrk` to be installed first'); const assert = require('assert'); -const spawn = require('child_process').spawn; const http = require('http'); const url = require('url'); @@ -60,7 +62,7 @@ const runAb = (opts, callback) => { args.push(url.format({ hostname: '127.0.0.1', port: opts.port, protocol: 'http' })); - const child = spawn('wrk', args); + const child = child_process.spawn('wrk', args); child.stderr.pipe(process.stderr); child.stdout.setEncoding('utf8'); |