Permalink
Browse files

If ab isn't installed skip keep-alive test

  • Loading branch information...
1 parent 860fcf2 commit fcda5e8dfa6543e350f56dd4a7f9603a4b3c9580 @ry ry committed Feb 20, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 test/mjsunit/test-keep-alive.js
@@ -18,13 +18,15 @@ server.listen(PORT);
var keepAliveReqSec = 0;
var normalReqSec = 0;
-function error (msg) {
- throw new Error("ERROR. 'ab' not installed? " + msg);
-}
function runAb(opts, callback) {
var command = "ab " + opts + " http://127.0.0.1:" + PORT + "/";
sys.exec(command, function (err, stdout, stderr) {
+ if (err) {
+ puts("ab not installed? skipping test.\n" + stderr);
+ process.exit();
+ return;
+ }
if (err) throw err;
var matches = /Requests per second:\s*(\d+)\./mi.exec(stdout);
var reqSec = parseInt(matches[1]);

0 comments on commit fcda5e8

Please sign in to comment.