Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d390f7

Browse filesBrowse files
apapirovskiMylesBorins
authored andcommitted
test: add test for tls benchmarks
PR-URL: #18489 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 958f5ed commit 0d390f7
Copy full SHA for 0d390f7

File tree

Expand file treeCollapse file tree

2 files changed

+26
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+26
-1
lines changed
Open diff view settings
Collapse file

‎benchmark/tls/throughput.js‎

Copy file name to clipboardExpand all lines: benchmark/tls/throughput.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ function main({ dur, type, size }) {
4040
};
4141

4242
server = tls.createServer(options, onConnection);
43-
setTimeout(done, dur * 1000);
4443
var conn;
4544
server.listen(common.PORT, function() {
4645
const opt = { port: common.PORT, rejectUnauthorized: false };
4746
conn = tls.connect(opt, function() {
47+
setTimeout(done, dur * 1000);
4848
bench.start();
4949
conn.on('drain', write);
5050
write();
Collapse file
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
if (!common.enoughTestMem)
6+
common.skip('Insufficient memory for TLS benchmark test');
7+
8+
// Because the TLS benchmarks use hardcoded ports, this should be in sequential
9+
// rather than parallel to make sure it does not conflict with tests that choose
10+
// random available ports.
11+
12+
const runBenchmark = require('../common/benchmark');
13+
14+
runBenchmark('tls',
15+
[
16+
'concurrency=1',
17+
'dur=0.1',
18+
'n=1',
19+
'size=2',
20+
'type=asc'
21+
],
22+
{
23+
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
24+
duration: 0
25+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.