Skip to content

Commit b476119

Browse files
committed
CSHARP-2298: Re-sync transaction spec tests.
1 parent 4277ce0 commit b476119

File tree

14 files changed

+1928
-52
lines changed

14 files changed

+1928
-52
lines changed

tests/MongoDB.Driver.Tests.Dotnet/Specifications/transactions/tests/README.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ Each YAML file has the following keys:
108108

109109
- ``arguments``: Optional, the names and values of arguments.
110110

111-
- ``result``: The return value from the operation, if any. If the
112-
operation is expected to return an error, the ``result`` has one or more
113-
of the following fields:
111+
- ``result``: The return value from the operation, if any. This field may
112+
be a single document or an array of documents in the case of a
113+
multi-document read. If the operation is expected to return an error, the
114+
``result`` is a single document that has one or more of the following
115+
fields:
114116

115117
- ``errorContains``: A substring of the expected error message.
116118

@@ -138,9 +140,9 @@ Use as integration tests
138140
========================
139141

140142
Run a MongoDB replica set with a primary, a secondary, and an arbiter,
141-
server version 4.0 or later. (Including a secondary ensures that server
142-
selection in a transaction works properly. Including an arbiter helps ensure
143-
that no new bugs have been introduced related to arbiters.)
143+
**server version 4.0.0-rc4 or later**. (Including a secondary ensures that
144+
server selection in a transaction works properly. Including an arbiter helps
145+
ensure that no new bugs have been introduced related to arbiters.)
144146

145147
Load each YAML (or JSON) file using a Canonical Extended JSON parser.
146148

@@ -230,11 +232,6 @@ Then for each element in ``tests``:
230232
Primary read preference even when the MongoClient is configured with
231233
another read preference.
232234

233-
TODO:
234-
235-
- drivers MUST retry commit/abort, needs to use failpoint.
236-
- test writeConcernErrors
237-
238235
Command-Started Events
239236
``````````````````````
240237

tests/MongoDB.Driver.Tests.Dotnet/Specifications/transactions/tests/commit.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ tests:
119119
expectations:
120120
- command_started_event:
121121
command:
122-
insert: test
122+
insert: *collection_name
123123
documents:
124124
- _id: 1
125125
ordered: true
@@ -131,7 +131,7 @@ tests:
131131
autocommit: false
132132
writeConcern:
133133
command_name: insert
134-
database_name: transaction-tests
134+
database_name: *database_name
135135
- command_started_event:
136136
command:
137137
commitTransaction: 1
@@ -314,7 +314,7 @@ tests:
314314
expectations:
315315
- command_started_event:
316316
command:
317-
insert: test
317+
insert: *collection_name
318318
documents:
319319
- _id: 1
320320
ordered: true
@@ -326,7 +326,7 @@ tests:
326326
autocommit: false
327327
writeConcern:
328328
command_name: insert
329-
database_name: transaction-tests
329+
database_name: *database_name
330330
- command_started_event:
331331
command:
332332
abortTransaction: 1
@@ -379,7 +379,7 @@ tests:
379379
expectations:
380380
- command_started_event:
381381
command:
382-
insert: test
382+
insert: *collection_name
383383
documents:
384384
- _id: 1
385385
ordered: true
@@ -391,7 +391,7 @@ tests:
391391
autocommit: false
392392
writeConcern:
393393
command_name: insert
394-
database_name: transaction-tests
394+
database_name: *database_name
395395
- command_started_event:
396396
command:
397397
abortTransaction: 1
@@ -405,7 +405,7 @@ tests:
405405
database_name: admin
406406
- command_started_event:
407407
command:
408-
insert: test
408+
insert: *collection_name
409409
documents:
410410
- _id: 1
411411
ordered: true
@@ -419,7 +419,7 @@ tests:
419419
autocommit: false
420420
writeConcern:
421421
command_name: insert
422-
database_name: transaction-tests
422+
database_name: *database_name
423423
- command_started_event:
424424
command:
425425
abortTransaction: 1

0 commit comments

Comments
 (0)