From d5a7a6d5756dd55a651d43bb9d47bade80bcca86 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 13 Oct 2021 08:55:12 -0400 Subject: chore: fix flaky steps_invalid_usage tests (#12422) --- runtime/js/40_testing.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index b55e5cc2c..5b404766e 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -47,8 +47,8 @@ await new Promise((resolve) => setTimeout(resolve, 0)); } - if (step.hasRunningChildren) { - return; // test step validation error thrown, don't check ops + if (step.shouldSkipSanitizers) { + return; } const post = metrics(); @@ -111,8 +111,8 @@ finishing test case.`; const pre = core.resources(); await fn(step); - if (step.hasRunningChildren) { - return; // test step validation error thrown, don't check resources + if (step.shouldSkipSanitizers) { + return; } const post = core.resources(); @@ -360,6 +360,7 @@ finishing test case.`; "failed": formatError(error), }; } finally { + step.finalized = true; // ensure the children report their result for (const child of step.children) { child.reportResult(); @@ -529,6 +530,13 @@ finishing test case.`; this.#params.sanitizeExit; } + /** If a test validation error already occurred then don't bother checking + * the sanitizers as that will create extra noise. + */ + get shouldSkipSanitizers() { + return this.hasRunningChildren || this.parent?.finalized; + } + get hasRunningChildren() { return ArrayPrototypeSome( this.children, -- cgit v1.2.3