From ee59763ab3b67f8792ed53a4d098212a040994f9 Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Fri, 17 May 2019 00:59:57 +0200 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- test/async-hooks/verify-graph.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/async-hooks/verify-graph.js b/test/async-hooks/verify-graph.js index 54d6ed8ea9a..638edd03a4a 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]}`); } };