Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test, benchmark: create shared runBenchmark func #15004

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[squash] convert test-benchmark-dns
  • Loading branch information
maclover7 committed Sep 8, 2017
commit b3f4c413f57357ff4a0f26319231ac4681746961
21 changes: 2 additions & 19 deletions test/parallel/test-benchmark-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,9 @@

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 runBenchmark = require('../common/benchmark');

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);
});
runBenchmark('dns', ['n=1', 'all=false', 'name=127.0.0.1'], env);