Skip to content

Commit 35ecb57

Browse files
committed
CSHARP-2753: Avoid using readConcern snapshot in sharded transaction tests
1 parent 1f91e97 commit 35ecb57

File tree

8 files changed

+354
-326
lines changed

8 files changed

+354
-326
lines changed

tests/MongoDB.Driver.Tests/Specifications/transactions-convenient-api/tests/transaction-options.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"session0": {
193193
"defaultTransactionOptions": {
194194
"readConcern": {
195-
"level": "snapshot"
195+
"level": "majority"
196196
},
197197
"writeConcern": {
198198
"w": 1
@@ -243,7 +243,7 @@
243243
"startTransaction": true,
244244
"autocommit": false,
245245
"readConcern": {
246-
"level": "snapshot"
246+
"level": "majority"
247247
},
248248
"writeConcern": null
249249
},
@@ -308,7 +308,7 @@
308308
},
309309
"options": {
310310
"readConcern": {
311-
"level": "snapshot"
311+
"level": "majority"
312312
},
313313
"writeConcern": {
314314
"w": 1
@@ -335,7 +335,7 @@
335335
"startTransaction": true,
336336
"autocommit": false,
337337
"readConcern": {
338-
"level": "snapshot"
338+
"level": "majority"
339339
},
340340
"writeConcern": null
341341
},
@@ -380,7 +380,7 @@
380380
"session0": {
381381
"defaultTransactionOptions": {
382382
"readConcern": {
383-
"level": "majority"
383+
"level": "snapshot"
384384
},
385385
"writeConcern": {
386386
"w": "majority"
@@ -412,7 +412,7 @@
412412
},
413413
"options": {
414414
"readConcern": {
415-
"level": "snapshot"
415+
"level": "majority"
416416
},
417417
"writeConcern": {
418418
"w": 1
@@ -439,7 +439,7 @@
439439
"startTransaction": true,
440440
"autocommit": false,
441441
"readConcern": {
442-
"level": "snapshot"
442+
"level": "majority"
443443
},
444444
"writeConcern": null
445445
},
@@ -481,7 +481,7 @@
481481
"description": "withTransaction explicit transaction options override client options",
482482
"useMultipleMongoses": true,
483483
"clientOptions": {
484-
"readConcernLevel": "majority",
484+
"readConcernLevel": "local",
485485
"w": "majority"
486486
},
487487
"operations": [
@@ -508,7 +508,7 @@
508508
},
509509
"options": {
510510
"readConcern": {
511-
"level": "snapshot"
511+
"level": "majority"
512512
},
513513
"writeConcern": {
514514
"w": 1
@@ -535,7 +535,7 @@
535535
"startTransaction": true,
536536
"autocommit": false,
537537
"readConcern": {
538-
"level": "snapshot"
538+
"level": "majority"
539539
},
540540
"writeConcern": null
541541
},

tests/MongoDB.Driver.Tests/Specifications/transactions-convenient-api/tests/transaction-options.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tests:
108108
sessionOptions:
109109
session0:
110110
defaultTransactionOptions:
111-
readConcern: { level: snapshot }
111+
readConcern: { level: majority }
112112
writeConcern: { w: 1 }
113113
operations: *operations
114114
expectations:
@@ -123,7 +123,7 @@ tests:
123123
txnNumber: { $numberLong: "1" }
124124
startTransaction: true
125125
autocommit: false
126-
readConcern: { level: snapshot }
126+
readConcern: { level: majority }
127127
# omitted fields
128128
writeConcern: ~
129129
command_name: insert
@@ -161,7 +161,7 @@ tests:
161161
result:
162162
insertedId: 1
163163
options:
164-
readConcern: { level: snapshot }
164+
readConcern: { level: majority }
165165
writeConcern: { w: 1 }
166166
expectations:
167167
-
@@ -175,7 +175,7 @@ tests:
175175
txnNumber: { $numberLong: "1" }
176176
startTransaction: true
177177
autocommit: false
178-
readConcern: { level: snapshot }
178+
readConcern: { level: majority }
179179
# omitted fields
180180
writeConcern: ~
181181
command_name: insert
@@ -200,7 +200,7 @@ tests:
200200
sessionOptions:
201201
session0:
202202
defaultTransactionOptions:
203-
readConcern: { level: majority }
203+
readConcern: { level: snapshot }
204204
writeConcern: { w: majority }
205205
operations: *operations_explicit_transactionOptions
206206
expectations:
@@ -215,7 +215,7 @@ tests:
215215
txnNumber: { $numberLong: "1" }
216216
startTransaction: true
217217
autocommit: false
218-
readConcern: { level: snapshot }
218+
readConcern: { level: majority }
219219
# omitted fields
220220
writeConcern: ~
221221
command_name: insert
@@ -238,7 +238,7 @@ tests:
238238
description: withTransaction explicit transaction options override client options
239239
useMultipleMongoses: true
240240
clientOptions:
241-
readConcernLevel: majority
241+
readConcernLevel: local
242242
w: majority
243243
operations: *operations_explicit_transactionOptions
244244
expectations:
@@ -253,7 +253,7 @@ tests:
253253
txnNumber: { $numberLong: "1" }
254254
startTransaction: true
255255
autocommit: false
256-
readConcern: { level: snapshot }
256+
readConcern: { level: majority }
257257
# omitted fields
258258
writeConcern: ~
259259
command_name: insert

tests/MongoDB.Driver.Tests/Specifications/transactions/tests/read-concern.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"arguments": {
4040
"options": {
4141
"readConcern": {
42-
"level": "snapshot"
42+
"level": "majority"
4343
}
4444
}
4545
}
@@ -110,7 +110,7 @@
110110
"cursor": {},
111111
"lsid": "session0",
112112
"readConcern": {
113-
"level": "snapshot"
113+
"level": "majority"
114114
},
115115
"txnNumber": {
116116
"$numberLong": "1"
@@ -202,7 +202,7 @@
202202
"arguments": {
203203
"options": {
204204
"readConcern": {
205-
"level": "snapshot"
205+
"level": "majority"
206206
}
207207
}
208208
}
@@ -274,7 +274,7 @@
274274
"batchSize": 3,
275275
"lsid": "session0",
276276
"readConcern": {
277-
"level": "snapshot"
277+
"level": "majority"
278278
},
279279
"txnNumber": {
280280
"$numberLong": "1"
@@ -389,7 +389,7 @@
389389
"arguments": {
390390
"options": {
391391
"readConcern": {
392-
"level": "snapshot"
392+
"level": "majority"
393393
}
394394
}
395395
}
@@ -484,7 +484,7 @@
484484
},
485485
"lsid": "session0",
486486
"readConcern": {
487-
"level": "snapshot"
487+
"level": "majority"
488488
},
489489
"txnNumber": {
490490
"$numberLong": "1"
@@ -608,7 +608,7 @@
608608
"arguments": {
609609
"options": {
610610
"readConcern": {
611-
"level": "snapshot"
611+
"level": "majority"
612612
}
613613
}
614614
}
@@ -664,7 +664,7 @@
664664
"key": "_id",
665665
"lsid": "session0",
666666
"readConcern": {
667-
"level": "snapshot"
667+
"level": "majority"
668668
},
669669
"txnNumber": {
670670
"$numberLong": "1"
@@ -741,7 +741,7 @@
741741
"arguments": {
742742
"options": {
743743
"readConcern": {
744-
"level": "snapshot"
744+
"level": "majority"
745745
}
746746
}
747747
}
@@ -780,7 +780,7 @@
780780
"find": "test",
781781
"lsid": "session0",
782782
"readConcern": {
783-
"level": "snapshot"
783+
"level": "majority"
784784
},
785785
"txnNumber": {
786786
"$numberLong": "1"

tests/MongoDB.Driver.Tests/Specifications/transactions/tests/read-concern.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tests:
2525
arguments:
2626
options:
2727
readConcern:
28-
level: snapshot
28+
level: majority
2929
- &countDocuments
3030
name: countDocuments
3131
object: collection
@@ -51,7 +51,7 @@ tests:
5151
cursor: {}
5252
lsid: session0
5353
readConcern:
54-
level: snapshot
54+
level: majority
5555
txnNumber:
5656
$numberLong: "1"
5757
startTransaction: true
@@ -116,7 +116,7 @@ tests:
116116
batchSize: 3
117117
lsid: session0
118118
readConcern:
119-
level: snapshot
119+
level: majority
120120
txnNumber:
121121
$numberLong: "1"
122122
startTransaction: true
@@ -202,7 +202,7 @@ tests:
202202
batchSize: 3
203203
lsid: session0
204204
readConcern:
205-
level: snapshot
205+
level: majority
206206
txnNumber:
207207
$numberLong: "1"
208208
startTransaction: true
@@ -282,7 +282,7 @@ tests:
282282
key: _id
283283
lsid: session0
284284
readConcern:
285-
level: snapshot
285+
level: majority
286286
txnNumber:
287287
$numberLong: "1"
288288
startTransaction: true
@@ -328,7 +328,7 @@ tests:
328328
find: *collection_name
329329
lsid: session0
330330
readConcern:
331-
level: snapshot
331+
level: majority
332332
txnNumber:
333333
$numberLong: "1"
334334
startTransaction: true

0 commit comments

Comments
 (0)