Permalink
Browse files

benchmark: missing process.exit after bench.end

Previously bench.end would call process.exit(0) however this is rather
confusing and indeed a few benchmarks had code that assumed otherwise.

This adds process.exit(0) to the benchmarks that needs it.

PR-URL: #7094
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information...
AndreasMadsen committed May 31, 2016
1 parent f99471b commit 8bb59fdb127b060d38430c0428d7783931ebec6e
@@ -67,6 +67,7 @@ function server() {
var bytes = sent * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
@@ -58,6 +58,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
@@ -50,6 +50,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
@@ -50,6 +50,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
@@ -26,6 +26,7 @@ function main(conf) {
setTimeout(function() {
bench.end(reads);
try { fs.unlinkSync(filename); } catch (e) {}
process.exit(0);
}, +conf.dur * 1000);
function read() {
@@ -81,6 +81,7 @@ function main(conf) {
count += 1;
if (count === num) {
bench.end(count);
process.exit(0);
} else {
WriteHTTPHeaders(socket, 1, min + size);
}
@@ -65,5 +65,6 @@ function main(conf) {
function done() {
bench.end(nreqs);
process.exit(0);
}
}
@@ -84,6 +84,7 @@ function server() {
var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
function send() {
@@ -106,6 +106,7 @@ function server() {
var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
@@ -109,6 +109,7 @@ function server() {
var bytes = writer.received * 2;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
@@ -106,6 +106,7 @@ function server() {
var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
@@ -56,6 +56,7 @@ function server() {
setTimeout(function() {
// report in Gb/sec
bench.end((bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000);
clientHandle.onread = function(nread, buffer) {
@@ -116,6 +116,7 @@ function client() {
// multiply by 2 since we're sending it first one way
// then then back again.
bench.end(2 * (bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000);
while (clientHandle.writeQueueSize === 0)
@@ -135,6 +135,7 @@ function client() {
setTimeout(function() {
// report in Gb/sec
bench.end((bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000);
};
}
@@ -61,4 +61,5 @@ function done() {
// don't always match. Generally, serverConn will be
// the smaller number, but take the min just to be sure.
bench.end(Math.min(serverConn, clientConn));
process.exit(0);
}

0 comments on commit 8bb59fd

Please sign in to comment.