Skip to content

Commit 8bb59fd

Browse files
committed
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 <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent f99471b commit 8bb59fd

15 files changed

+15
-0
lines changed

benchmark/dgram/array-vs-concat.js

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function server() {
6767
var bytes = sent * len;
6868
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
6969
bench.end(gbits);
70+
process.exit(0);
7071
}, dur * 1000);
7172
});
7273

benchmark/dgram/multi-buffer.js

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function server() {
5858
var bytes = (type === 'send' ? sent : received) * len;
5959
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
6060
bench.end(gbits);
61+
process.exit(0);
6162
}, dur * 1000);
6263
});
6364

benchmark/dgram/offset-length.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function server() {
5050
var bytes = (type === 'send' ? sent : received) * chunk.length;
5151
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
5252
bench.end(gbits);
53+
process.exit(0);
5354
}, dur * 1000);
5455
});
5556

benchmark/dgram/single-buffer.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function server() {
5050
var bytes = (type === 'send' ? sent : received) * chunk.length;
5151
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
5252
bench.end(gbits);
53+
process.exit(0);
5354
}, dur * 1000);
5455
});
5556

benchmark/fs/readfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function main(conf) {
2626
setTimeout(function() {
2727
bench.end(reads);
2828
try { fs.unlinkSync(filename); } catch (e) {}
29+
process.exit(0);
2930
}, +conf.dur * 1000);
3031

3132
function read() {

benchmark/http/_chunky_http_client.js

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function main(conf) {
8181
count += 1;
8282
if (count === num) {
8383
bench.end(count);
84+
process.exit(0);
8485
} else {
8586
WriteHTTPHeaders(socket, 1, min + size);
8687
}

benchmark/http/client-request-body.js

+1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ function main(conf) {
6565

6666
function done() {
6767
bench.end(nreqs);
68+
process.exit(0);
6869
}
6970
}

benchmark/net/net-c2s-cork.js

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function server() {
8484
var bytes = writer.received;
8585
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
8686
bench.end(gbits);
87+
process.exit(0);
8788
}, dur * 1000);
8889

8990
function send() {

benchmark/net/net-c2s.js

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ function server() {
106106
var bytes = writer.received;
107107
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
108108
bench.end(gbits);
109+
process.exit(0);
109110
}, dur * 1000);
110111
});
111112
});

benchmark/net/net-pipe.js

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function server() {
109109
var bytes = writer.received * 2;
110110
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
111111
bench.end(gbits);
112+
process.exit(0);
112113
}, dur * 1000);
113114
});
114115
});

benchmark/net/net-s2c.js

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ function server() {
106106
var bytes = writer.received;
107107
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
108108
bench.end(gbits);
109+
process.exit(0);
109110
}, dur * 1000);
110111
});
111112
});

benchmark/net/tcp-raw-c2s.js

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function server() {
5656
setTimeout(function() {
5757
// report in Gb/sec
5858
bench.end((bytes * 8) / (1024 * 1024 * 1024));
59+
process.exit(0);
5960
}, dur * 1000);
6061

6162
clientHandle.onread = function(nread, buffer) {

benchmark/net/tcp-raw-pipe.js

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function client() {
116116
// multiply by 2 since we're sending it first one way
117117
// then then back again.
118118
bench.end(2 * (bytes * 8) / (1024 * 1024 * 1024));
119+
process.exit(0);
119120
}, dur * 1000);
120121

121122
while (clientHandle.writeQueueSize === 0)

benchmark/net/tcp-raw-s2c.js

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ function client() {
135135
setTimeout(function() {
136136
// report in Gb/sec
137137
bench.end((bytes * 8) / (1024 * 1024 * 1024));
138+
process.exit(0);
138139
}, dur * 1000);
139140
};
140141
}

benchmark/tls/tls-connect.js

+1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ function done() {
6161
// don't always match. Generally, serverConn will be
6262
// the smaller number, but take the min just to be sure.
6363
bench.end(Math.min(serverConn, clientConn));
64+
process.exit(0);
6465
}

0 commit comments

Comments
 (0)