Skip to content

Commit

Permalink
test: better error message in trace events test
Browse files Browse the repository at this point in the history
PR-URL: #20655
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
addaleax committed May 14, 2018
1 parent 44960a0 commit 9c1c03e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-trace-events-async-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const fs = require('fs');
const util = require('util');

const CODE =
'setTimeout(() => { for (var i = 0; i < 100000; i++) { "test" + i } }, 1)';
Expand Down Expand Up @@ -58,9 +59,9 @@ proc.once('exit', common.mustCall(() => {
const initEvents = traces.filter((trace) => {
return (trace.ph === 'b' && !trace.name.includes('_CALLBACK'));
});
assert(initEvents.every((trace) => {
assert.ok(initEvents.every((trace) => {
return (trace.args.executionAsyncId > 0 &&
trace.args.triggerAsyncId > 0);
}));
}), `Unexpected initEvents format: ${util.inspect(initEvents)}`);
}));
}));

0 comments on commit 9c1c03e

Please sign in to comment.