Skip to content

Commit

Permalink
Small changes on locking tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidJGapCR committed Nov 6, 2023
1 parent e2c7cfa commit 7eb8c31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,9 @@ describe('given a delete concurrent with an insert referencing the to-be-deleted

await mongoDocumentCollection.deleteOne({ _id: schoolMeadowlarkId }, { session: deleteSession });
} catch (e) {
expect(e.message).toContain(
'WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction.',
expect(e).toMatchInlineSnapshot(
'[MongoBulkWriteError: WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction.]',
);
expect(e.name).toBe('MongoBulkWriteError');
expect(e.codeName).toBe('WriteConflict');
expect(e.code).toBe(112);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,9 @@ describe('given an upsert (update) concurrent with an insert referencing the to-

await mongoDocumentCollection.replaceOne({ _id: schoolMeadowlarkId }, schoolDocument, asUpsert(updateSession));
} catch (e) {
expect(e.message).toContain(
'WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction.',
expect(e).toMatchInlineSnapshot(
'[MongoBulkWriteError: WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction.]',
);
expect(e.name).toBe('MongoBulkWriteError');
expect(e.codeName).toBe('WriteConflict');
expect(e.code).toBe(112);
}

Expand Down

0 comments on commit 7eb8c31

Please sign in to comment.