From e63a9cc4e93e406229a094e5796cf4a5adfb9172 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 12 Oct 2018 10:44:03 -0700 Subject: [PATCH 1/2] test: added async-hook benchmark Added a minimalist benchmark test for the async-hooks. --- lib/assert.js | 2 +- test/common/benchmark.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/assert.js b/lib/assert.js index 9990d0e888e1c5..9d16b07a432a09 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -82,7 +82,7 @@ const NO_EXCEPTION_SENTINEL = {}; function innerFail(obj) { if (obj.message instanceof Error) throw obj.message; - + console.log('---------------------------------------------------- here is where the error is ----------------------------------------------------') throw new AssertionError(obj); } diff --git a/test/common/benchmark.js b/test/common/benchmark.js index 0894146c4d1443..b44330285f8c43 100644 --- a/test/common/benchmark.js +++ b/test/common/benchmark.js @@ -32,6 +32,8 @@ function runBenchmark(name, args, env) { }); child.on('exit', (code, signal) => { + console.log('---------------------------------------------------- here is code ----------------------------------------------------') + console.log(code) assert.strictEqual(code, 0); assert.strictEqual(signal, null); // This bit makes sure that each benchmark file is being sent settings such From dbd354b8fd49a79935ae4f8ac752d453455691c0 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 12 Oct 2018 10:54:49 -0700 Subject: [PATCH 2/2] test: modified benchmark-async-hooks I made some formatting changes to the file I was working on and removed some extra comments. --- lib/assert.js | 2 +- test/common/benchmark.js | 2 -- test/sequential/test-benchmark-async-hooks.js | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 test/sequential/test-benchmark-async-hooks.js diff --git a/lib/assert.js b/lib/assert.js index 9d16b07a432a09..9990d0e888e1c5 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -82,7 +82,7 @@ const NO_EXCEPTION_SENTINEL = {}; function innerFail(obj) { if (obj.message instanceof Error) throw obj.message; - console.log('---------------------------------------------------- here is where the error is ----------------------------------------------------') + throw new AssertionError(obj); } diff --git a/test/common/benchmark.js b/test/common/benchmark.js index b44330285f8c43..0894146c4d1443 100644 --- a/test/common/benchmark.js +++ b/test/common/benchmark.js @@ -32,8 +32,6 @@ function runBenchmark(name, args, env) { }); child.on('exit', (code, signal) => { - console.log('---------------------------------------------------- here is code ----------------------------------------------------') - console.log(code) assert.strictEqual(code, 0); assert.strictEqual(signal, null); // This bit makes sure that each benchmark file is being sent settings such diff --git a/test/sequential/test-benchmark-async-hooks.js b/test/sequential/test-benchmark-async-hooks.js new file mode 100644 index 00000000000000..a6a27270f650b4 --- /dev/null +++ b/test/sequential/test-benchmark-async-hooks.js @@ -0,0 +1,18 @@ +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.enoughTestMem) + common.skip('Insufficient memory for TLS benchmark test'); + +const runBenchmark = require('../common/benchmark'); + +runBenchmark('async_hooks', + [ + 'method=trackingDisabled', + 'n=10' + ], + {});