diff --git a/source/client-side-operations-timeout/tests/convenient-transactions.json b/source/client-side-operations-timeout/tests/convenient-transactions.json index 07e676d5f5..c389d309c6 100644 --- a/source/client-side-operations-timeout/tests/convenient-transactions.json +++ b/source/client-side-operations-timeout/tests/convenient-transactions.json @@ -81,6 +81,9 @@ } } ] + }, + "expectError": { + "isClientError": true } } ], @@ -182,6 +185,21 @@ } } } + }, + { + "commandStartedEvent": { + "commandName": "abortTransaction", + "databaseName": "admin", + "command": { + "abortTransaction": 1, + "maxTimeMS": { + "$$type": [ + "int", + "long" + ] + } + } + } } ] } diff --git a/source/client-side-operations-timeout/tests/convenient-transactions.yml b/source/client-side-operations-timeout/tests/convenient-transactions.yml index d79aa4bd05..8ce24139c5 100644 --- a/source/client-side-operations-timeout/tests/convenient-transactions.yml +++ b/source/client-side-operations-timeout/tests/convenient-transactions.yml @@ -49,6 +49,8 @@ tests: timeoutMS: 100 expectError: isClientError: true + expectError: + isClientError: true expectEvents: # The only operation run fails with a client-side error, so there should be no events for the client. - client: *client @@ -88,9 +90,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 @@ -103,3 +102,9 @@ tests: command: insert: *collectionName maxTimeMS: { $$type: ["int", "long"] } + - commandStartedEvent: + commandName: abortTransaction + databaseName: admin + command: + abortTransaction: 1 + maxTimeMS: { $$type: [ "int", "long" ] } diff --git a/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.json b/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.json index abbc321732..cc4aab5919 100644 --- a/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.json @@ -302,6 +302,26 @@ "commandFailedEvent": { "commandName": "insert" } + }, + { + "commandStartedEvent": { + "commandName": "abortTransaction", + "databaseName": "admin", + "command": { + "abortTransaction": 1, + "maxTimeMS": { + "$$type": [ + "int", + "long" + ] + } + } + } + }, + { + "commandFailedEvent": { + "commandName": "abortTransaction" + } } ] } diff --git a/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.yml b/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.yml index 184ef7eb9e..fdae34b49d 100644 --- a/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/sessions-inherit-timeoutMS.yml @@ -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 @@ -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 diff --git a/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.json b/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.json index 0254b184a1..1018069d92 100644 --- a/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.json @@ -306,6 +306,26 @@ "commandFailedEvent": { "commandName": "insert" } + }, + { + "commandStartedEvent": { + "commandName": "abortTransaction", + "databaseName": "admin", + "command": { + "abortTransaction": 1, + "maxTimeMS": { + "$$type": [ + "int", + "long" + ] + } + } + } + }, + { + "commandFailedEvent": { + "commandName": "abortTransaction" + } } ] } diff --git a/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.yml b/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.yml index 8a80a65720..ae535e68a7 100644 --- a/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/sessions-override-operation-timeoutMS.yml @@ -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 @@ -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 diff --git a/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.json b/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.json index c46ae4dd50..7cb39f94e2 100644 --- a/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.json @@ -302,6 +302,26 @@ "commandFailedEvent": { "commandName": "insert" } + }, + { + "commandStartedEvent": { + "commandName": "abortTransaction", + "databaseName": "admin", + "command": { + "abortTransaction": 1, + "maxTimeMS": { + "$$type": [ + "int", + "long" + ] + } + } + } + }, + { + "commandFailedEvent": { + "commandName": "abortTransaction" + } } ] } diff --git a/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.yml b/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.yml index 61aaab4d97..a0e9d17090 100644 --- a/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/sessions-override-timeoutMS.yml @@ -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 @@ -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