-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
benchmark: fix issues in dns benchmark
The benchmark script for dns contained functions with args declared but never used. This fix removes those arguments from the function signatures. No test existed for the dns benchmark so one was added to the parallel suite. To improve performance the tests are limited to 1 invocation to a single endpoint. PR-URL: #14936 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
- Loading branch information
1 parent
7f62378
commit 7feb994
Showing
2 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
|
||
// Minimal test for dns benchmarks. This makes sure the benchmarks aren't | ||
// horribly broken but nothing more than that. | ||
|
||
const assert = require('assert'); | ||
const fork = require('child_process').fork; | ||
const path = require('path'); | ||
|
||
const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js'); | ||
|
||
const env = Object.assign({}, process.env, | ||
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); | ||
|
||
const child = fork(runjs, | ||
['--set', 'n=1', | ||
'--set', 'all=false', | ||
'--set', 'name=127.0.0.1', | ||
'dns'], | ||
{ env }); | ||
|
||
child.on('exit', (code, signal) => { | ||
assert.strictEqual(code, 0); | ||
assert.strictEqual(signal, null); | ||
}); |