From 0b66d3377f8e7b2bd09dea19818c96af01fae26d 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 --- 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 54d6ed8ea9ade0..638edd03a4ab24 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]}`); } };