Skip to content

Commit

Permalink
distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Mar 5, 2024
1 parent 2c94515 commit 4e10c52
Show file tree
Hide file tree
Showing 2 changed files with 570 additions and 0 deletions.
399 changes: 399 additions & 0 deletions source/retryable-reads/tests/unified/distinct-serverErrors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,399 @@
# This file was created automatically using mongodb-spec-converter.
# Please review the generated file, then remove this notice.

description: distinct-serverErrors

schemaVersion: '1.9'

runOnRequirements:
-
minServerVersion: '4.0'
topologies:
- single
- replicaset
-
minServerVersion: 4.1.7
topologies:
- sharded
- load-balanced

createEntities:
-
client:
id: &client0 client0
useMultipleMongoses: false
observeEvents:
- commandStartedEvent
-
database:
id: &database0 database0
client: *client0
databaseName: &database_name retryable-reads-tests
-
collection:
id: &collection0 collection0
database: *database0
collectionName: &collection_name coll

initialData:
-
collectionName: *collection_name
databaseName: *database_name
documents:
-
_id: 1
x: 11
-
_id: 2
x: 22
-
_id: 3
x: 33

tests:
-
description: 'Distinct succeeds after InterruptedAtShutdown'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint: &failCommand_failPoint
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 11600
- &retryable_operation_succeeds
object: *collection0
name: distinct
arguments:
fieldName: x
filter:
_id:
$gt: 1
expectResult:
- 22
- 33
expectEvents:
-
client: *client0
events:
- &retryable_command_started_event
commandStartedEvent:
command:
distinct: *collection_name
key: x
query:
_id:
$gt: 1
databaseName: *database_name
- *retryable_command_started_event
-
description: 'Distinct succeeds after InterruptedDueToReplStateChange'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 11602
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after NotWritablePrimary'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 10107
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after NotPrimaryNoSecondaryOk'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 13435
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after NotPrimaryOrSecondary'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 13436
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after PrimarySteppedDown'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 189
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after ShutdownInProgress'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 91
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after HostNotFound'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 7
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after HostUnreachable'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 6
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after NetworkTimeout'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 89
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct succeeds after SocketException'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 9001
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct fails after two NotWritablePrimary errors'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 2
data:
failCommands:
- distinct
errorCode: 10107
- &retryable_operation_fails
object: *collection0
name: distinct
arguments:
fieldName: x
filter:
_id:
$gt: 1
expectError:
isError: true
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'Distinct fails after NotWritablePrimary when retryReads is false'
operations:
-
object: testRunner
name: createEntities
arguments:
entities:
- client:
id: &client1 client1
useMultipleMongoses: false
uriOptions:
retryReads: false
observeEvents:
- commandStartedEvent
- database:
id: &database1 database1
client: *client1
databaseName: *database_name
- collection:
id: &collection1 collection1
database: *database1
collectionName: *collection_name
-
object: testRunner
name: failPoint
arguments:
client: *client1
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- distinct
errorCode: 10107
- <<: *retryable_operation_fails
object: *collection1
expectEvents:
-
client: *client1
events:
- *retryable_command_started_event
Loading

0 comments on commit 4e10c52

Please sign in to comment.