diff options
author | Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> | 2019-05-17 00:59:57 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-05-19 23:09:42 +0200 |
commit | ee59763ab3b67f8792ed53a4d098212a040994f9 (patch) | |
tree | f40db1ce90f41288867c679b452c13fb17a29327 /test/async-hooks | |
parent | bd895af1f8509d472c7258f3dfe7c3e1aa9334b3 (diff) | |
download | android-node-v8-ee59763ab3b67f8792ed53a4d098212a040994f9.tar.gz android-node-v8-ee59763ab3b67f8792ed53a4d098212a040994f9.tar.bz2 android-node-v8-ee59763ab3b67f8792ed53a4d098212a040994f9.zip |
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: https://github.com/nodejs/node/pull/27477
Fixes: https://github.com/nodejs/node/issues/27617
PR-URL: https://github.com/nodejs/node/pull/27742
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/async-hooks')
-rw-r--r-- | test/async-hooks/verify-graph.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/async-hooks/verify-graph.js b/test/async-hooks/verify-graph.js index 54d6ed8ea9..638edd03a4 100644 --- a/test/async-hooks/verify-graph.js +++ b/test/async-hooks/verify-graph.js @@ -99,7 +99,7 @@ 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; @@ -107,9 +107,9 @@ module.exports = function verifyGraph(hooks, graph) { } 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]}`); } }; |