Skip to content

Commit f872210

Browse files
Flarnatargos
authored andcommitted
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 PR-URL: #27742 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent cf516f7 commit f872210

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/async-hooks/verify-graph.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ module.exports = function verifyGraph(hooks, graph) {
9999
}
100100
assert.strictEqual(errors.length, 0);
101101

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

109109
for (const type in expTypes) {
110-
assert.strictEqual(typeSeen[type], expTypes[type],
111-
`Type '${type}': expecting: ${expTypes[type]} ` +
112-
`found ${typeSeen[type]}`);
110+
assert.ok(typeSeen[type] >= expTypes[type],
111+
`Type '${type}': expecting: ${expTypes[type]} ` +
112+
`found: ${typeSeen[type]}`);
113113
}
114114
};
115115

0 commit comments

Comments
 (0)