Skip to content

RUBY-3361 Test-level runOnRequirements in retryable writes tests should not be more permissive than top-level runOnRequirements #2818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ description: "retryable-writes bulkWrite serverErrors"
schemaVersion: "1.0"

runOnRequirements:
- minServerVersion: "3.6"
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.7"
topologies: [ sharded ]

createEntities:
- client:
Expand All @@ -29,11 +31,6 @@ initialData:

tests:
- description: "BulkWrite succeeds after retryable writeConcernError in first batch"
runOnRequirements:
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.7"
topologies: [ sharded ]
operations:
- name: failPoint
object: testRunner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ description: "retryable-writes insertOne serverErrors"
schemaVersion: "1.0"

runOnRequirements:
- minServerVersion: "3.6"
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.7"
topologies: [ sharded ]

createEntities:
- client:
Expand All @@ -29,11 +31,6 @@ initialData:

tests:
- description: "InsertOne succeeds after retryable writeConcernError"
runOnRequirements:
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.7"
topologies: [ sharded ]
operations:
- name: failPoint
object: testRunner
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_tests/data/unified/valid-pass/poc-crud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ tests:
- description: "readConcern majority with out stage"
runOnRequirements:
- minServerVersion: "4.1.0"
topologies: [ replicaset, sharded-replicaset ]
topologies: [ replicaset, sharded ]
serverless: "forbid"
operations:
- name: aggregate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ description: "poc-retryable-writes"

schemaVersion: "1.0"

runOnRequirements:
- minServerVersion: "3.6"
topologies: [ replicaset ]

createEntities:
- client:
id: &client0 client0
Expand Down Expand Up @@ -42,6 +38,9 @@ initialData:

tests:
- description: "FindOneAndUpdate is committed on first attempt"
runOnRequirements: &onPrimaryTransactionalWrite_requirements
- minServerVersion: "3.6"
topologies: [ replicaset ]
operations:
- name: failPoint
object: testRunner
Expand All @@ -65,6 +64,7 @@ tests:
- { _id: 2, x: 22 }

- description: "FindOneAndUpdate is not committed on first attempt"
runOnRequirements: *onPrimaryTransactionalWrite_requirements
operations:
- name: failPoint
object: testRunner
Expand All @@ -89,6 +89,7 @@ tests:
- { _id: 2, x: 22 }

- description: "FindOneAndUpdate is never committed"
runOnRequirements: *onPrimaryTransactionalWrite_requirements
operations:
- name: failPoint
object: testRunner
Expand Down Expand Up @@ -117,9 +118,7 @@ tests:
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.7"
# Original test uses "sharded", but retryable writes requires a sharded
# cluster backed by replica sets
topologies: [ sharded-replicaset ]
topologies: [ sharded ]
operations:
- name: failPoint
object: testRunner
Expand Down Expand Up @@ -192,6 +191,7 @@ tests:
mode: { times: 2 }
data:
failCommands: [ insert ]
errorLabels: [ RetryableWriteError ]
writeConcernError:
code: 91 # ShutdownInProgress
errmsg: "Replication is being shut down"
Expand Down
7 changes: 3 additions & 4 deletions spec/spec_tests/data/unified/valid-pass/poc-sessions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,11 @@ tests:
- description: "Dirty explicit session is discarded"
skipReason: RUBY-1813
# Original test specified retryWrites=true, but that is now the default.
# Retryable writes will require a sharded-replicaset, though.
runOnRequirements:
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.8"
topologies: [ sharded-replicaset ]
topologies: [ sharded ]
operations:
- name: failPoint
object: testRunner
Expand Down Expand Up @@ -181,7 +180,7 @@ tests:
- commandStartedEvent: &insert_attempt
command:
insert: *collection0Name
documents:
documents:
- { _id: 2 }
ordered: true
lsid: { $$sessionLsid: *session0 }
Expand All @@ -192,7 +191,7 @@ tests:
- commandStartedEvent:
command:
insert: *collection0Name
documents:
documents:
- { _id: 3 }
ordered: true
lsid: { $$sessionLsid: *session0 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runOnRequirements:
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.8"
topologies: [ sharded-replicaset ]
topologies: [ sharded ]

createEntities:
- client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schemaVersion: "1.0"

runOnRequirements:
- minServerVersion: "4.1.8"
topologies: [ sharded-replicaset ]
topologies: [ sharded ]

createEntities:
- client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runOnRequirements:
- minServerVersion: "4.0"
topologies: [ replicaset ]
- minServerVersion: "4.1.8"
topologies: [ sharded-replicaset ]
topologies: [ sharded ]

createEntities:
- client:
Expand Down Expand Up @@ -51,7 +51,7 @@ tests:
- description: "explicitly create collection using create command"
runOnRequirements:
- minServerVersion: "4.3.4"
topologies: [ replicaset, sharded-replicaset ]
topologies: [ replicaset, sharded ]
operations:
- name: dropCollection
object: *database0
Expand Down Expand Up @@ -109,7 +109,7 @@ tests:
- description: "create index on a non-existing collection"
runOnRequirements:
- minServerVersion: "4.3.4"
topologies: [ replicaset, sharded-replicaset ]
topologies: [ replicaset, sharded ]
operations:
- name: dropCollection
object: *database0
Expand Down