Skip to content

Commit c9da50d

Browse files
authored
DRIVERS-3081: Relax requirement for optional fields and introducing appName for failPoints for transactions unified tests (#1742)
1 parent a909f80 commit c9da50d

10 files changed

+44
-20
lines changed

source/transactions/tests/unified/findOneAndReplace.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/transactions/tests/unified/findOneAndReplace.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ tests:
8888
findAndModify: *collection_name
8989
query: { _id: 3 }
9090
update: { x: 1 }
91-
new: false
91+
new: { $$unsetOrMatches: false }
9292
lsid: { $$sessionLsid: *session0 }
9393
txnNumber: { $numberLong: '1' }
9494
startTransaction: true
@@ -178,7 +178,7 @@ tests:
178178
findAndModify: *collection_name
179179
query: { _id: 3 }
180180
update: { x: 1 }
181-
new: false
181+
new: { $$unsetOrMatches: false }
182182
lsid: { $$sessionLsid: *session0 }
183183
txnNumber: { $numberLong: '1' }
184184
startTransaction: true

source/transactions/tests/unified/findOneAndUpdate.json

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/transactions/tests/unified/findOneAndUpdate.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ tests:
130130
findAndModify: *collection_name
131131
query: { _id: 3 }
132132
update: { $inc: { x: 1 } }
133-
new: false
133+
new: { $$unsetOrMatches: false }
134134
lsid: { $$sessionLsid: *session0 }
135135
txnNumber: { $numberLong: '1' }
136136
startTransaction: true
@@ -173,7 +173,7 @@ tests:
173173
findAndModify: *collection_name
174174
query: { _id: 3 }
175175
update: { $inc: { x: 1 } }
176-
new: false
176+
new: { $$unsetOrMatches: false }
177177
lsid: { $$sessionLsid: *session0 }
178178
txnNumber: { $numberLong: '2' }
179179
startTransaction: true
@@ -201,7 +201,7 @@ tests:
201201
findAndModify: *collection_name
202202
query: { _id: 3 }
203203
update: { $inc: { x: 1 } }
204-
new: false
204+
new: { $$unsetOrMatches: false }
205205
lsid: { $$sessionLsid: *session0 }
206206
txnNumber: { $numberLong: '3' }
207207
startTransaction: true
@@ -277,7 +277,7 @@ tests:
277277
findAndModify: *collection_name
278278
query: { _id: 3 }
279279
update: { $inc: { x: 1 } }
280-
new: false
280+
new: { $$unsetOrMatches: false }
281281
lsid: { $$sessionLsid: *session0 }
282282
txnNumber: { $numberLong: '1' }
283283
startTransaction: true

source/transactions/tests/unified/mongos-recovery-token.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/transactions/tests/unified/mongos-recovery-token.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ tests:
150150
# flight heartbeat refreshes the first mongoes' SDAM state in between
151151
# the initial commitTransaction and the retry attempt.
152152
heartbeatFrequencyMS: 30000
153+
appName: &appName transactionsClient
153154
observeEvents:
154155
- commandStartedEvent
155156
- database:
@@ -195,6 +196,7 @@ tests:
195196
- isMaster
196197
- hello
197198
closeConnection: true
199+
appName: *appName
198200
# The first commitTransaction sees a retryable connection error due to
199201
# the fail point and also fails on the server. The retry attempt on a
200202
# new mongos will wait for the transaction to timeout and will fail

source/transactions/tests/unified/pin-mongos.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/transactions/tests/unified/pin-mongos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ tests:
527527
# flight heartbeat refreshes the first mongoes' SDAM state in between
528528
# the insert connection error and the single commit attempt.
529529
heartbeatFrequencyMS: 30000
530+
appName: &appName transactionsClient
530531
observeEvents:
531532
- commandStartedEvent
532533
- database:
@@ -572,6 +573,7 @@ tests:
572573
- isMaster
573574
- hello
574575
closeConnection: true
576+
appName: *appName
575577
-
576578
object: *collection1
577579
name: insertOne

source/transactions/tests/unified/write-concern.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/transactions/tests/unified/write-concern.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ tests:
606606
findAndModify: *collection_name
607607
query: { _id: 0 }
608608
update: { x: 1 }
609-
new: false
609+
new: { $$unsetOrMatches: false }
610610
<<: *transactionCommandArgs
611611
commandName: findAndModify
612612
databaseName: *database_name
@@ -642,7 +642,7 @@ tests:
642642
findAndModify: *collection_name
643643
query: { _id: 0 }
644644
update: { $inc: { x: 1 } }
645-
new: false
645+
new: { $$unsetOrMatches: false }
646646
<<: *transactionCommandArgs
647647
commandName: findAndModify
648648
databaseName: *database_name

0 commit comments

Comments
 (0)