Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add check for wrk to test-keep-alive #25516

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: common.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