From 782ca9a0c831488e73132246a9b17abb7426b503 Mon Sep 17 00:00:00 2001 From: Onur Temizkan Date: Thu, 5 Dec 2024 19:20:11 +0000 Subject: [PATCH] fix(test-utils): Don't swallow assertion errors from `checkResult` and `checkCollector`. --- packages/opentelemetry-test-utils/src/test-fixtures.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/opentelemetry-test-utils/src/test-fixtures.ts b/packages/opentelemetry-test-utils/src/test-fixtures.ts index 37995ffa04..ff76db0d7b 100644 --- a/packages/opentelemetry-test-utils/src/test-fixtures.ts +++ b/packages/opentelemetry-test-utils/src/test-fixtures.ts @@ -236,7 +236,7 @@ export async function runTestFixture( const collector = new TestCollector(); await collector.start(); - return new Promise(resolve => { + return new Promise((resolve, reject) => { execFile( process.execPath, opts.argv, @@ -261,6 +261,8 @@ export async function runTestFixture( if (opts.checkCollector) { await opts.checkCollector(collector); } + } catch(err) { + reject(err); } finally { collector.close(); resolve();