Skip to content

Commit 7b253eb

Browse files
TrottItalo A. Casas
authored andcommitted
test: increase strictness for test-trace-event
Change test-trace-event such that it checks that all expected values are within the same trace object rather than scattered across multiple trace objects. PR-URL: #11065 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 96f55f9 commit 7b253eb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎test/parallel/test-trace-event.js‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ proc_no_categories.once('exit', common.mustCall(() =>{
2121

2222
proc.once('exit',common.mustCall(()=>{
2323
assert(common.fileExists(FILE_NAME));
24-
fs.readFile(FILE_NAME,(err,data)=>{
24+
fs.readFile(FILE_NAME,common.mustCall((err,data)=>{
2525
consttraces=JSON.parse(data.toString()).traceEvents;
2626
assert(traces.length>0);
2727
// Values that should be present on all runs to approximate correctness.
28-
assert(traces.some((trace)=>{returntrace.pid===proc.pid;}));
29-
assert(traces.some((trace)=>{returntrace.cat==='v8';}));
3028
assert(traces.some((trace)=>{
31-
returntrace.name==='V8.ScriptCompiler';
29+
if(trace.pid!==proc.pid)
30+
returnfalse;
31+
if(trace.cat!=='v8')
32+
returnfalse;
33+
if(trace.name!=='V8.ScriptCompiler')
34+
returnfalse;
35+
returntrue;
3236
}));
33-
});
37+
}));
3438
}));
3539
}));

0 commit comments

Comments
(0)