Skip to content

Commit 3dae92c

Browse files
RUBY-3623 Rename WriteConcernFailed code name to WriteConcernTimeout (#3032)
1 parent c173493 commit 3dae92c

4 files changed

Lines changed: 10 additions & 14 deletions

File tree

spec/mongo/auth/user/view_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@
473473
failCommands: [ failCommand ],
474474
writeConcernError: {
475475
code: 64,
476-
codeName: 'WriteConcernFailed',
476+
codeName: 'WriteConcernTimeout',
477477
errmsg: 'waiting for replication timed out',
478478
errInfo: { wtimeout: true }
479479
}
@@ -494,7 +494,7 @@
494494
expect(e.write_concern_error?).to be true
495495
expect(e.write_concern_error_document).to eq(
496496
'code' => 64,
497-
'codeName' => 'WriteConcernFailed',
497+
'codeName' => 'WriteConcernTimeout',
498498
'errmsg' => 'waiting for replication timed out',
499499
'errInfo' => { 'wtimeout' => true }
500500
)

spec/spec_tests/data/retryable_writes/legacy/insertOne-serverErrors.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,15 +480,14 @@ tests:
480480
- { _id: 2, x: 22 }
481481
- { _id: 3, x: 33 } # The write was still applied.
482482
-
483-
description: "InsertOne fails after WriteConcernError WriteConcernFailed"
483+
description: "InsertOne fails after WriteConcernError WriteConcernTimeout"
484484
failPoint:
485485
configureFailPoint: failCommand
486486
mode: { times: 1 }
487487
data:
488488
failCommands: ["insert"]
489489
writeConcernError:
490490
code: 64
491-
codeName: WriteConcernFailed
492491
errmsg: waiting for replication timed out
493492
errInfo: {wtimeout: True}
494493
operation:

spec/spec_tests/data/transactions/error-labels.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,15 +736,15 @@ tests:
736736
collection:
737737
data: []
738738

739-
- description: add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed
739+
- description: add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout
740740

741741
failPoint:
742742
configureFailPoint: failCommand
743743
mode: { times: 1 }
744744
data:
745745
failCommands: ["commitTransaction"]
746746
writeConcernError:
747-
code: 64 # WriteConcernFailed without wtimeout
747+
code: 64 # WriteConcernTimeout without wtimeout
748748
errmsg: multiple errors reported
749749

750750
operations:
@@ -816,7 +816,7 @@ tests:
816816
data:
817817
- _id: 1
818818

819-
- description: add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout
819+
- description: add UnknownTransactionCommitResult label to writeConcernError WriteConcernTimeout with wtimeout
820820

821821
failPoint:
822822
configureFailPoint: failCommand
@@ -825,7 +825,6 @@ tests:
825825
failCommands: ["commitTransaction"]
826826
writeConcernError:
827827
code: 64
828-
codeName: WriteConcernFailed
829828
errmsg: waiting for replication timed out
830829
errInfo: {wtimeout: True}
831830

spec/spec_tests/data/transactions_api/commit-writeconcernerror.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ data: []
1313

1414
tests:
1515
-
16-
description: commitTransaction is retried after WriteConcernFailed timeout error
16+
description: commitTransaction is retried after WriteConcernTimeout timeout error
1717
failPoint:
1818
configureFailPoint: failCommand
1919
mode: { times: 2 }
@@ -23,7 +23,6 @@ tests:
2323
# with writeConcernError (see: SERVER-39292)
2424
writeConcernError:
2525
code: 64
26-
codeName: WriteConcernFailed
2726
errmsg: "waiting for replication timed out"
2827
errInfo: { wtimeout: true }
2928
operations:
@@ -106,10 +105,10 @@ tests:
106105
- { _id: 1 }
107106
-
108107
# This test configures the fail point to return an error with the
109-
# WriteConcernFailed code but without errInfo that would identify it as a
108+
# WriteConcernTimeout code but without errInfo that would identify it as a
110109
# wtimeout error. This tests that drivers do not assume that all
111-
# WriteConcernFailed errors are due to a replication timeout.
112-
description: commitTransaction is retried after WriteConcernFailed non-timeout error
110+
# WriteConcernTimeout errors are due to a replication timeout.
111+
description: commitTransaction is retried after WriteConcernTimeout non-timeout error
113112
failPoint:
114113
configureFailPoint: failCommand
115114
mode: { times: 2 }
@@ -119,7 +118,6 @@ tests:
119118
# with writeConcernError (see: SERVER-39292)
120119
writeConcernError:
121120
code: 64
122-
codeName: WriteConcernFailed
123121
errmsg: "multiple errors reported"
124122
operations:
125123
- *operation

0 commit comments

Comments
 (0)