You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe('when an operation fails inside withTransaction callback',()=>{
720
-
/**
721
-
* 1. Using `internalClient`, drop the `db.coll` collection.
722
-
* 1. Using `internalClient`, set the following fail point:
723
-
* ```js
724
-
* {
725
-
* configureFailPoint: failCommand,
726
-
* mode: { times: 2 },
727
-
* data: {
728
-
* failCommands: ["insert", "abortTransaction"],
729
-
* blockConnection: true,
730
-
* blockTimeMS: 15
731
-
* }
732
-
* }
733
-
* ```
734
-
* 1. Create a new MongoClient (referred to as `client`) configured with `timeoutMS=10` and an explicit ClientSession derived from that MongoClient (referred to as `session`).
735
-
* 1. Using `session`, execute a `withTransaction` operation with the following callback:
736
-
* ```js
737
-
* function callback() {
738
-
* coll = client.database("db").collection("coll")
739
-
* coll.insert_one({ _id: 1 }, session=session)
740
-
* }
741
-
* ```
742
-
* 1. Expect the previous `withTransaction` call to fail with a timeout error.
743
-
* 1. Verify that the following events were published during the `withTransaction` call:
744
-
* 1. `command_started` and `command_failed` events for an `insert` command.
745
-
* 1. `command_started` and `command_failed` events for an `abortTransaction` command.
746
-
*/
713
+
describe('when an operation fails inside withTransaction callback',()=>{
714
+
/**
715
+
* 1. Using `internalClient`, drop the `db.coll` collection.
716
+
* 1. Using `internalClient`, set the following fail point:
717
+
* ```js
718
+
* {
719
+
* configureFailPoint: failCommand,
720
+
* mode: { times: 2 },
721
+
* data: {
722
+
* failCommands: ["insert", "abortTransaction"],
723
+
* blockConnection: true,
724
+
* blockTimeMS: 15
725
+
* }
726
+
* }
727
+
* ```
728
+
* 1. Create a new MongoClient (referred to as `client`) configured with `timeoutMS=10` and an explicit ClientSession derived from that MongoClient (referred to as `session`).
729
+
* 1. Using `session`, execute a `withTransaction` operation with the following callback:
730
+
* ```js
731
+
* function callback() {
732
+
* coll = client.database("db").collection("coll")
733
+
* coll.insert_one({ _id: 1 }, session=session)
734
+
* }
735
+
* ```
736
+
* 1. Expect the previous `withTransaction` call to fail with a timeout error.
737
+
* 1. Verify that the following events were published during the `withTransaction` call:
738
+
* 1. `command_started` and `command_failed` events for an `insert` command.
739
+
* 1. `command_started` and `command_failed` events for an `abortTransaction` command.
0 commit comments