Skip to content

Commit

Permalink
estimatedDocumentCount
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Mar 5, 2024
1 parent 4e10c52 commit 2a3945f
Show file tree
Hide file tree
Showing 2 changed files with 530 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,379 @@
# This file was created automatically using mongodb-spec-converter.
# Please review the generated file, then remove this notice.

description: estimatedDocumentCount-serverErrors

schemaVersion: '1.9'

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

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

tests:
-
description: 'EstimatedDocumentCount succeeds after InterruptedAtShutdown'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint: &failCommand_failPoint
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 11600
- &retryable_operation_succeeds
object: *collection0
name: estimatedDocumentCount
expectResult: 2
expectEvents:
-
client: *client0
events:
- &retryable_command_started_event
commandStartedEvent:
command:
count: *collection_name
databaseName: *database_name
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 11602
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after NotWritablePrimary'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 10107
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 13435
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after NotPrimaryOrSecondary'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 13436
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after PrimarySteppedDown'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 189
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after ShutdownInProgress'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 91
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after HostNotFound'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 7
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after HostUnreachable'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 6
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after NetworkTimeout'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 89
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount succeeds after SocketException'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- count
errorCode: 9001
- *retryable_operation_succeeds
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount fails after two NotWritablePrimary errors'
operations:
-
object: testRunner
name: failPoint
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode:
times: 2
data:
failCommands:
- count
errorCode: 10107
- &retryable_operation_fails
object: *collection0
name: estimatedDocumentCount
expectError:
isError: true
expectEvents:
-
client: *client0
events:
- *retryable_command_started_event
- *retryable_command_started_event
-
description: 'EstimatedDocumentCount 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:
- count
errorCode: 10107
- <<: *retryable_operation_fails
object: *collection1
expectEvents:
-
client: *client1
events:
- *retryable_command_started_event
Loading

0 comments on commit 2a3945f

Please sign in to comment.