From beca27e319e505972bbc2d3e42b52a8101bcf258 Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Mon, 7 Aug 2023 19:40:11 +0200 Subject: [PATCH] test(NODE-3049): drivers atlas testing --- test/tools/unified-spec-runner/entity_event_registry.ts | 2 +- test/tools/unified-spec-runner/operations.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/tools/unified-spec-runner/entity_event_registry.ts b/test/tools/unified-spec-runner/entity_event_registry.ts index 3c64416b60..25c9c862a9 100644 --- a/test/tools/unified-spec-runner/entity_event_registry.ts +++ b/test/tools/unified-spec-runner/entity_event_registry.ts @@ -40,7 +40,7 @@ const MAPPINGS = { /** * Registers events that need to be stored in the entities map, since - * the UnifiedMongoClient does not contain a ciclical dependency on the + * the UnifiedMongoClient does not contain a cyclical dependency on the * entities map itself. */ export class EntityEventRegistry { diff --git a/test/tools/unified-spec-runner/operations.ts b/test/tools/unified-spec-runner/operations.ts index 757733363f..8b6cdbda4d 100644 --- a/test/tools/unified-spec-runner/operations.ts +++ b/test/tools/unified-spec-runner/operations.ts @@ -12,6 +12,7 @@ import { type Document, type GridFSFile, type MongoClient, + MongoError, type ObjectId, ReadConcern, ReadPreference, @@ -410,6 +411,7 @@ operations.set('loop', async ({ entities, operation, client, testConfig }) => { entities.set(storeSuccessesAsEntity, successes++); } } catch (error) { + console.log(error); // From the unified spec: // If neither storeErrorsAsEntity nor storeFailuresAsEntity are specified, // the loop MUST terminate and raise the error/failure (i.e. the error/failure @@ -437,7 +439,8 @@ operations.set('loop', async ({ entities, operation, client, testConfig }) => { entities .getEntity('failures', storeFailuresAsEntity) .push({ error: error.message, time: Date.now() }); - } else if (storeErrorsAsEntity) { + } else if (storeErrorsAsEntity && !(error instanceof MongoError)) { + // Checking not a MongoError ensures it's coming from the test runner. entities .getEntity('errors', storeErrorsAsEntity) .push({ error: error.message, time: Date.now() });