Skip to content
Closed
Changes from all commits
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
test: relax check in verify-graph
Relax the check regarding presence of async resources in graph to
allow extra events. Before this change events not mentioned in
reference graph were allowed but that one specified must match
exactly in count. Now it's allowed to have more events of this
type.

Refs: #27477
Fixes: #27617
  • Loading branch information
Flarna committed May 16, 2019
commit 0b66d3377f8e7b2bd09dea19818c96af01fae26d
8 changes: 4 additions & 4 deletions test/async-hooks/verify-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ module.exports = function verifyGraph(hooks, graph) {
}
assert.strictEqual(errors.length, 0);

// Verify that all expected types are present
// Verify that all expected types are present (but more/others are allowed)
const expTypes = Object.create(null);
for (let i = 0; i < graph.length; i++) {
if (expTypes[graph[i].type] == null) expTypes[graph[i].type] = 0;
expTypes[graph[i].type]++;
}

for (const type in expTypes) {
assert.strictEqual(typeSeen[type], expTypes[type],
`Type '${type}': expecting: ${expTypes[type]} ` +
`found ${typeSeen[type]}`);
assert.ok(typeSeen[type] >= expTypes[type],
`Type '${type}': expecting: ${expTypes[type]} ` +
`found: ${typeSeen[type]}`);
}
};

Expand Down