Skip to content

Commit

Permalink
test: add check for wrk to test-keep-alive
Browse files Browse the repository at this point in the history
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: #25516
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed May 16, 2019
1 parent 37082bd commit f4da641
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/pummel/test-keep-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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');

Expand Down

0 comments on commit f4da641

Please sign in to comment.