Skip to content

Commit

Permalink
CSOT tests: Expect withTransaction to propagate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rozza committed Mar 21, 2024
1 parent 2c3be08 commit 894d7ef
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ tests:
expectEvents:
- client: *client
events:
# Because the second insert expects an error and gets an error, it technically succeeds, so withTransaction
# will try to run commitTransaction. This will fail client-side, though, because the timeout has already
# expired, so no command is sent.
- commandStartedEvent:
commandName: insert
databaseName: *databaseName
Expand All @@ -103,3 +100,11 @@ tests:
command:
insert: *collectionName
maxTimeMS: { $$type: ["int", "long"] }
- commandStartedEvent:
commandName: abortTransaction
databaseName: admin
command:
abortTransaction: 1
maxTimeMS: { $$type: [ "int", "long" ] }
- commandFailedEvent:
commandName: abortTransaction

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ tests:
expectEvents:
- client: *client
events:
# Because the insert expects an error and gets an error, it technically succeeds, so withTransaction will
# try to run commitTransaction. This will fail client-side, though, because the timeout has already expired,
# so no command is sent.
- commandStartedEvent:
commandName: insert
databaseName: *databaseName
Expand All @@ -166,3 +163,11 @@ tests:
maxTimeMS: { $$type: ["int", "long"] }
- commandFailedEvent:
commandName: insert
- commandStartedEvent:
commandName: abortTransaction
databaseName: admin
command:
abortTransaction: 1
maxTimeMS: { $$type: [ "int", "long" ] }
- commandFailedEvent:
commandName: abortTransaction

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ tests:
expectEvents:
- client: *client
events:
# Because the insert expects an error and gets an error, it technically succeeds, so withTransaction will
# try to run commitTransaction. This will fail client-side, though, because the timeout has already expired,
# so no command is sent.
- commandStartedEvent:
commandName: insert
databaseName: *databaseName
Expand All @@ -169,3 +166,11 @@ tests:
maxTimeMS: { $$type: ["int", "long"] }
- commandFailedEvent:
commandName: insert
- commandStartedEvent:
commandName: abortTransaction
databaseName: admin
command:
abortTransaction: 1
maxTimeMS: { $$type: ["int", "long"] }
- commandFailedEvent:
commandName: abortTransaction

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ tests:
expectEvents:
- client: *client
events:
# Because the insert expects an error and gets an error, it technically succeeds, so withTransaction will
# try to run commitTransaction. This will fail client-side, though, because the timeout has already expired,
# so no command is sent.
- commandStartedEvent:
commandName: insert
databaseName: *databaseName
Expand All @@ -166,3 +163,11 @@ tests:
maxTimeMS: { $$type: ["int", "long"] }
- commandFailedEvent:
commandName: insert
- commandStartedEvent:
commandName: abortTransaction
databaseName: admin
command:
abortTransaction: 1
maxTimeMS: { $$type: [ "int", "long" ] }
- commandFailedEvent:
commandName: abortTransaction

0 comments on commit 894d7ef

Please sign in to comment.