1{
2  "runOn": [
3    {
4      "minServerVersion": "4.0",
5      "topology": [
6        "replicaset"
7      ]
8    },
9    {
10      "minServerVersion": "4.1.8",
11      "topology": [
12        "sharded"
13      ]
14    }
15  ],
16  "database_name": "transaction-tests",
17  "collection_name": "test",
18  "data": [],
19  "tests": [
20    {
21      "description": "start insert start",
22      "operations": [
23        {
24          "name": "startTransaction",
25          "object": "session0"
26        },
27        {
28          "name": "insertOne",
29          "object": "collection",
30          "arguments": {
31            "session": "session0",
32            "document": {
33              "_id": 1
34            }
35          },
36          "result": {
37            "insertedId": 1
38          }
39        },
40        {
41          "name": "startTransaction",
42          "object": "session0",
43          "result": {
44            "errorContains": "transaction already in progress"
45          }
46        },
47        {
48          "name": "commitTransaction",
49          "object": "session0"
50        }
51      ]
52    },
53    {
54      "description": "start twice",
55      "operations": [
56        {
57          "name": "startTransaction",
58          "object": "session0"
59        },
60        {
61          "name": "startTransaction",
62          "object": "session0",
63          "result": {
64            "errorContains": "transaction already in progress"
65          }
66        }
67      ]
68    },
69    {
70      "description": "commit and start twice",
71      "operations": [
72        {
73          "name": "startTransaction",
74          "object": "session0"
75        },
76        {
77          "name": "insertOne",
78          "object": "collection",
79          "arguments": {
80            "session": "session0",
81            "document": {
82              "_id": 1
83            }
84          },
85          "result": {
86            "insertedId": 1
87          }
88        },
89        {
90          "name": "commitTransaction",
91          "object": "session0"
92        },
93        {
94          "name": "startTransaction",
95          "object": "session0"
96        },
97        {
98          "name": "startTransaction",
99          "object": "session0",
100          "result": {
101            "errorContains": "transaction already in progress"
102          }
103        }
104      ]
105    },
106    {
107      "description": "write conflict commit",
108      "operations": [
109        {
110          "name": "startTransaction",
111          "object": "session0"
112        },
113        {
114          "name": "insertOne",
115          "object": "collection",
116          "arguments": {
117            "session": "session0",
118            "document": {
119              "_id": 1
120            }
121          },
122          "result": {
123            "insertedId": 1
124          }
125        },
126        {
127          "name": "startTransaction",
128          "object": "session1"
129        },
130        {
131          "name": "insertOne",
132          "object": "collection",
133          "arguments": {
134            "session": "session1",
135            "document": {
136              "_id": 1
137            }
138          },
139          "result": {
140            "errorCodeName": "WriteConflict",
141            "errorLabelsContain": [
142              "TransientTransactionError"
143            ],
144            "errorLabelsOmit": [
145              "UnknownTransactionCommitResult"
146            ]
147          }
148        },
149        {
150          "name": "commitTransaction",
151          "object": "session0"
152        },
153        {
154          "name": "commitTransaction",
155          "object": "session1",
156          "result": {
157            "errorCodeName": "NoSuchTransaction",
158            "errorLabelsContain": [
159              "TransientTransactionError"
160            ],
161            "errorLabelsOmit": [
162              "UnknownTransactionCommitResult"
163            ]
164          }
165        }
166      ]
167    },
168    {
169      "description": "write conflict abort",
170      "operations": [
171        {
172          "name": "startTransaction",
173          "object": "session0"
174        },
175        {
176          "name": "insertOne",
177          "object": "collection",
178          "arguments": {
179            "session": "session0",
180            "document": {
181              "_id": 1
182            }
183          },
184          "result": {
185            "insertedId": 1
186          }
187        },
188        {
189          "name": "startTransaction",
190          "object": "session1"
191        },
192        {
193          "name": "insertOne",
194          "object": "collection",
195          "arguments": {
196            "session": "session1",
197            "document": {
198              "_id": 1
199            }
200          },
201          "result": {
202            "errorCodeName": "WriteConflict",
203            "errorLabelsContain": [
204              "TransientTransactionError"
205            ],
206            "errorLabelsOmit": [
207              "UnknownTransactionCommitResult"
208            ]
209          }
210        },
211        {
212          "name": "commitTransaction",
213          "object": "session0"
214        },
215        {
216          "name": "abortTransaction",
217          "object": "session1"
218        }
219      ]
220    }
221  ]
222}
223