Skip to content

Commit

Permalink
DRIVERS-2799: Use more permissive top-level runOnRequirements (#1484)
Browse files Browse the repository at this point in the history
* DRIVERS-2799: Use more permissive top-level runOnRequirements

This avoids unintentionally skipping tests. Previously, some tests were never run on sharded clusters.

* Add RetryableWriteError error label via failCommand fail point

This ensures the unified test is consistent with the legacy test from which it was derived. Additionally, it makes the test resilient to possible changes in DRIVERS-1641.

This inconsistency dates back to e4808b8.
  • Loading branch information
jmikola authored Dec 20, 2023
1 parent 6943ba1 commit 4c73bb1
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 54 deletions.
22 changes: 7 additions & 15 deletions source/retryable-writes/tests/unified/bulkWrite-serverErrors.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
22 changes: 7 additions & 15 deletions source/retryable-writes/tests/unified/insertOne-serverErrors.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -190,6 +191,7 @@ tests:
mode: { times: 2 }
data:
failCommands: [ insert ]
errorLabels: [ RetryableWriteError ]
writeConcernError:
code: 91 # ShutdownInProgress
errmsg: "Replication is being shut down"
Expand Down

0 comments on commit 4c73bb1

Please sign in to comment.