Skip to content

Commit

Permalink
test(NODE-3049): drivers atlas testing
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Aug 30, 2023
1 parent f73d179 commit beca27e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/tools/unified-spec-runner/entity_event_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion test/tools/unified-spec-runner/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
type Document,
type GridFSFile,
type MongoClient,
MongoError,
type ObjectId,
ReadConcern,
ReadPreference,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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() });
Expand Down

0 comments on commit beca27e

Please sign in to comment.