aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-trace-events-async-hooks.js
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2017-11-24 16:08:47 +0100
committerAndreas Madsen <amwebdk@gmail.com>2017-11-24 21:52:11 +0100
commitad80c2120672975018f5d93dad5e5cb9cf900de2 (patch)
tree132b8ef2283e4120640736a408390b7786b5f7cf /test/parallel/test-trace-events-async-hooks.js
parentdc389bf7cc8b297d4f8dd24603ee1793116f3414 (diff)
downloadandroid-node-v8-ad80c2120672975018f5d93dad5e5cb9cf900de2.tar.gz
android-node-v8-ad80c2120672975018f5d93dad5e5cb9cf900de2.tar.bz2
android-node-v8-ad80c2120672975018f5d93dad5e5cb9cf900de2.zip
trace_events: add executionAsyncId to init events
async_hooks emits trace_events. This adds the executionAsyncId to the init events. In theory this could be inferred from the before and after events but this is much simpler and doesn't require knowledge of all events. PR-URL: https://github.com/nodejs/node/pull/17196 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-trace-events-async-hooks.js')
-rw-r--r--test/parallel/test-trace-events-async-hooks.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/parallel/test-trace-events-async-hooks.js b/test/parallel/test-trace-events-async-hooks.js
index 7f8fb10620..e1f78f791a 100644
--- a/test/parallel/test-trace-events-async-hooks.js
+++ b/test/parallel/test-trace-events-async-hooks.js
@@ -43,7 +43,6 @@ proc.once('exit', common.mustCall(() => {
return true;
}));
-
// JavaScript async_hooks trace events should be generated.
assert(traces.some((trace) => {
if (trace.pid !== proc.pid)
@@ -54,5 +53,14 @@ proc.once('exit', common.mustCall(() => {
return false;
return true;
}));
+
+ // Check args in init events
+ const initEvents = traces.filter((trace) => {
+ return (trace.ph === 'b' && !trace.name.includes('_CALLBACK'));
+ });
+ assert(initEvents.every((trace) => {
+ return (trace.args.executionAsyncId > 0 &&
+ trace.args.triggerAsyncId > 0);
+ }));
}));
}));