133 lines
3.5 KiB
YAML
133 lines
3.5 KiB
YAML
---
|
|
description: auth-network-error
|
|
|
|
schemaVersion: "1.4"
|
|
|
|
runOnRequirements:
|
|
# failCommand appName requirements
|
|
- minServerVersion: "4.4"
|
|
auth: true
|
|
serverless: forbid
|
|
topologies: [ single, replicaset, sharded ]
|
|
|
|
createEntities:
|
|
- client:
|
|
id: &setupClient setupClient
|
|
useMultipleMongoses: false
|
|
|
|
initialData: &initialData
|
|
- collectionName: &collectionName auth-network-error
|
|
databaseName: &databaseName sdam-tests
|
|
documents:
|
|
- _id: 1
|
|
- _id: 2
|
|
|
|
tests:
|
|
- description: Reset server and pool after network error during authentication
|
|
operations:
|
|
- name: failPoint
|
|
object: testRunner
|
|
arguments:
|
|
client: *setupClient
|
|
failPoint:
|
|
configureFailPoint: failCommand
|
|
mode:
|
|
times: 1
|
|
data:
|
|
failCommands:
|
|
- saslContinue
|
|
closeConnection: true
|
|
appName: authNetworkErrorTest
|
|
- name: createEntities
|
|
object: testRunner
|
|
arguments:
|
|
entities:
|
|
- client:
|
|
id: &client client
|
|
useMultipleMongoses: false
|
|
observeEvents:
|
|
- commandStartedEvent
|
|
- serverDescriptionChangedEvent
|
|
- poolClearedEvent
|
|
uriOptions:
|
|
retryWrites: false
|
|
appname: authNetworkErrorTest
|
|
- database:
|
|
id: &database database
|
|
client: *client
|
|
databaseName: *databaseName
|
|
- collection:
|
|
id: &collection collection
|
|
database: *database
|
|
collectionName: *collectionName
|
|
- name: insertMany
|
|
object: *collection
|
|
arguments:
|
|
documents:
|
|
- _id: 3
|
|
- _id: 4
|
|
expectError:
|
|
isError: true
|
|
- name: waitForEvent
|
|
object: testRunner
|
|
arguments:
|
|
client: *client
|
|
event:
|
|
serverDescriptionChangedEvent:
|
|
newDescription:
|
|
type: Unknown
|
|
count: 1
|
|
- name: waitForEvent
|
|
object: testRunner
|
|
arguments:
|
|
client: *client
|
|
event:
|
|
poolClearedEvent: {}
|
|
count: 1
|
|
# Perform another operation to ensure the node is rediscovered.
|
|
- name: insertMany
|
|
object: *collection
|
|
arguments:
|
|
documents:
|
|
- _id: 5
|
|
- _id: 6
|
|
# Assert the server was marked Unknown and pool was cleared exactly once.
|
|
- name: assertEventCount
|
|
object: testRunner
|
|
arguments:
|
|
client: *client
|
|
event:
|
|
serverDescriptionChangedEvent:
|
|
newDescription:
|
|
type: Unknown
|
|
count: 1
|
|
- name: assertEventCount
|
|
object: testRunner
|
|
arguments:
|
|
client: *client
|
|
event:
|
|
poolClearedEvent: {}
|
|
count: 1
|
|
expectEvents:
|
|
# Note: The first insert command is never attempted because connection
|
|
# checkout fails.
|
|
- client: *client
|
|
eventType: command
|
|
events:
|
|
- commandStartedEvent:
|
|
command:
|
|
insert: auth-network-error
|
|
documents:
|
|
- _id: 5
|
|
- _id: 6
|
|
commandName: insert
|
|
databaseName: *databaseName
|
|
outcome:
|
|
- collectionName: *collectionName
|
|
databaseName: *databaseName
|
|
documents:
|
|
- _id: 1
|
|
- _id: 2
|
|
- _id: 5
|
|
- _id: 6
|