File tree Expand file tree Collapse file tree 5 files changed +236
-8
lines changed
tests/MongoDB.Driver.Tests/Specifications/transactions Expand file tree Collapse file tree 5 files changed +236
-8
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,6 @@ public TransactionUnifiedTestRunner(ITestOutputHelper testOutputHelper)
38
38
[ ClassData ( typeof ( TestCaseFactory ) ) ]
39
39
public void Run ( JsonDrivenTestCase testCase )
40
40
{
41
- if ( testCase . Name . Contains ( "mongos-unpin.json" ) )
42
- {
43
- throw new SkipException ( "Load balancer support not yet implemented." ) ;
44
- }
45
-
46
41
using ( var runner = new UnifiedTestRunner ( loggerFactory : LoggerFactory ) )
47
42
{
48
43
runner . Run ( testCase ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "description" : " do not retry read in a transaction" ,
3
+ "schemaVersion" : " 1.4" ,
4
+ "runOnRequirements" : [
5
+ {
6
+ "minServerVersion" : " 4.0.0" ,
7
+ "topologies" : [
8
+ " replicaset"
9
+ ]
10
+ },
11
+ {
12
+ "minServerVersion" : " 4.2.0" ,
13
+ "topologies" : [
14
+ " sharded" ,
15
+ " load-balanced"
16
+ ]
17
+ }
18
+ ],
19
+ "createEntities" : [
20
+ {
21
+ "client" : {
22
+ "id" : " client0" ,
23
+ "useMultipleMongoses" : false ,
24
+ "observeEvents" : [
25
+ " commandStartedEvent"
26
+ ],
27
+ "uriOptions" : {
28
+ "retryReads" : true
29
+ }
30
+ }
31
+ },
32
+ {
33
+ "database" : {
34
+ "id" : " database0" ,
35
+ "client" : " client0" ,
36
+ "databaseName" : " retryable-read-in-transaction-test"
37
+ }
38
+ },
39
+ {
40
+ "collection" : {
41
+ "id" : " collection0" ,
42
+ "database" : " database0" ,
43
+ "collectionName" : " coll"
44
+ }
45
+ },
46
+ {
47
+ "session" : {
48
+ "id" : " session0" ,
49
+ "client" : " client0"
50
+ }
51
+ }
52
+ ],
53
+ "tests" : [
54
+ {
55
+ "description" : " find does not retry in a transaction" ,
56
+ "operations" : [
57
+ {
58
+ "name" : " startTransaction" ,
59
+ "object" : " session0"
60
+ },
61
+ {
62
+ "name" : " failPoint" ,
63
+ "object" : " testRunner" ,
64
+ "arguments" : {
65
+ "client" : " client0" ,
66
+ "failPoint" : {
67
+ "configureFailPoint" : " failCommand" ,
68
+ "mode" : {
69
+ "times" : 1
70
+ },
71
+ "data" : {
72
+ "failCommands" : [
73
+ " find"
74
+ ],
75
+ "closeConnection" : true
76
+ }
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "name" : " find" ,
82
+ "object" : " collection0" ,
83
+ "arguments" : {
84
+ "filter" : {},
85
+ "session" : " session0"
86
+ },
87
+ "expectError" : {
88
+ "isError" : true ,
89
+ "errorLabelsContain" : [
90
+ " TransientTransactionError"
91
+ ]
92
+ }
93
+ }
94
+ ],
95
+ "expectEvents" : [
96
+ {
97
+ "client" : " client0" ,
98
+ "events" : [
99
+ {
100
+ "commandStartedEvent" : {
101
+ "command" : {
102
+ "find" : " coll" ,
103
+ "filter" : {},
104
+ "startTransaction" : true
105
+ },
106
+ "commandName" : " find" ,
107
+ "databaseName" : " retryable-read-in-transaction-test"
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ ]
113
+ }
114
+ ]
115
+ }
Original file line number Diff line number Diff line change
1
+ description : " do not retry read in a transaction"
2
+
3
+ schemaVersion : " 1.4"
4
+
5
+ runOnRequirements :
6
+ - minServerVersion : " 4.0.0"
7
+ topologies : [ replicaset ]
8
+ - minServerVersion : " 4.2.0"
9
+ topologies : [ sharded, load-balanced ]
10
+
11
+ createEntities :
12
+ - client :
13
+ id : &client0 client0
14
+ useMultipleMongoses : false
15
+ observeEvents : [commandStartedEvent]
16
+ uriOptions : { retryReads: true }
17
+ - database :
18
+ id : &database0 database0
19
+ client : *client0
20
+ databaseName : &databaseName retryable-read-in-transaction-test
21
+ - collection :
22
+ id : &collection0 collection0
23
+ database : *database0
24
+ collectionName : &collectionName coll
25
+ - session :
26
+ id : &session0 session0
27
+ client : *client0
28
+
29
+ tests :
30
+ - description : " find does not retry in a transaction"
31
+ operations :
32
+
33
+ - name : startTransaction
34
+ object : *session0
35
+
36
+ - name : failPoint # fail the following find command
37
+ object : testRunner
38
+ arguments :
39
+ client : *client0
40
+ failPoint :
41
+ configureFailPoint : failCommand
42
+ mode : { times: 1 }
43
+ data :
44
+ failCommands : [find]
45
+ closeConnection : true
46
+
47
+ - name : find
48
+ object : *collection0
49
+ arguments :
50
+ filter : {}
51
+ session : *session0
52
+ expectError :
53
+ isError : true
54
+ errorLabelsContain : ["TransientTransactionError"]
55
+ expectEvents :
56
+ - client : *client0
57
+ events :
58
+ - commandStartedEvent :
59
+ command :
60
+ find : *collectionName
61
+ filter : {}
62
+ startTransaction : true
63
+ commandName : find
64
+ databaseName : *databaseName
Original file line number Diff line number Diff line change 108
108
"arguments" : {
109
109
"session" : " session0"
110
110
}
111
+ },
112
+ {
113
+ "name" : " startTransaction" ,
114
+ "object" : " session0"
115
+ },
116
+ {
117
+ "name" : " insertOne" ,
118
+ "object" : " collection0" ,
119
+ "arguments" : {
120
+ "document" : {
121
+ "x" : 1
122
+ },
123
+ "session" : " session0"
124
+ }
125
+ },
126
+ {
127
+ "name" : " abortTransaction" ,
128
+ "object" : " session0"
111
129
}
112
130
]
113
131
},
142
160
]
143
161
},
144
162
{
145
- "description" : " unpin after TransientTransactionError error on abort" ,
163
+ "description" : " unpin after non-transient error on abort" ,
146
164
"runOnRequirements" : [
147
165
{
148
166
"serverless" : " forbid"
192
210
"arguments" : {
193
211
"session" : " session0"
194
212
}
213
+ },
214
+ {
215
+ "name" : " startTransaction" ,
216
+ "object" : " session0"
217
+ },
218
+ {
219
+ "name" : " insertOne" ,
220
+ "object" : " collection0" ,
221
+ "arguments" : {
222
+ "document" : {
223
+ "x" : 1
224
+ },
225
+ "session" : " session0"
226
+ }
227
+ },
228
+ {
229
+ "name" : " abortTransaction" ,
230
+ "object" : " session0"
195
231
}
196
232
]
197
233
},
198
234
{
199
- "description" : " unpin after non-transient error on abort" ,
235
+ "description" : " unpin after TransientTransactionError error on abort" ,
200
236
"operations" : [
201
237
{
202
238
"name" : " startTransaction" ,
241
277
"arguments" : {
242
278
"session" : " session0"
243
279
}
280
+ },
281
+ {
282
+ "name" : " startTransaction" ,
283
+ "object" : " session0"
284
+ },
285
+ {
286
+ "name" : " insertOne" ,
287
+ "object" : " collection0" ,
288
+ "arguments" : {
289
+ "document" : {
290
+ "x" : 1
291
+ },
292
+ "session" : " session0"
293
+ }
294
+ },
295
+ {
296
+ "name" : " abortTransaction" ,
297
+ "object" : " session0"
244
298
}
245
299
]
246
300
},
Original file line number Diff line number Diff line change 85
85
- *abortTransaction
86
86
- *assertNoPinnedServer
87
87
88
- - description : unpin after TransientTransactionError error on abort
88
+ - description : unpin after non-transient error on abort
89
89
runOnRequirements :
90
90
# serverless proxy doesn't append error labels to errors in transactions
91
91
# caused by failpoints (CLOUDP-88216)
You can’t perform that action at this time.
0 commit comments