-
Notifications
You must be signed in to change notification settings - Fork 244
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
DRIVERS-1003 Introduce CMAP error tests #1369
Open
patrickfreed
wants to merge
25
commits into
mongodb:master
Choose a base branch
from
patrickfreed:DRIVERS-1003/cmap-establishment-failure-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
61886cb
wip test
patrickfreed f0b33d8
wip tests
patrickfreed fc6544f
more work on tests
patrickfreed a2e2c1e
add unified cmap tests
patrickfreed 143963c
test finishes
patrickfreed 9187634
error handling prose
patrickfreed 423cca6
error type clarification
patrickfreed d31abde
some touches
patrickfreed 72f5bbd
eliminate failpoint cmap format operation?
patrickfreed 471b39f
fix connection id in auth test
patrickfreed 88426d0
remove failpoint operation from CMAP format
patrickfreed 91b4d9c
don't ignore events test doesnt expect to see
patrickfreed 55bf35a
add concurrent error test
patrickfreed 0be3db6
combine logging unified tests into one unified directory
patrickfreed 7f9ad15
update checkout prose to mention errors, properly handle
patrickfreed 81e3f94
fix typos
patrickfreed ccee026
update changelog
patrickfreed d721af2
add period back in
patrickfreed 4d28ee3
skip tests on replicasets that need a single server
patrickfreed b1c7f02
fix appname
patrickfreed dbb8b67
add poolreadyevent to observe events
patrickfreed aa0d7ae
fix race in test
patrickfreed bec7969
remove extra connectionId field
patrickfreed 82521a3
Merge branch 'master' into DRIVERS-1003/cmap-establishment-failure-tests
patrickfreed 3c0d6a3
change new cmap-format tests to unified
patrickfreed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
source/connection-monitoring-and-pooling/tests/cmap-format/pool-checkout-error-checkin.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"version": 1, | ||
"style": "integration", | ||
"description": "checking in a connection after checkout fails closes connection", | ||
"runOn": [ | ||
{ | ||
"minServerVersion": "4.9.0", | ||
"auth": true | ||
} | ||
], | ||
"poolOptions": { | ||
"appName": "poolCheckOutErrorCheckInTest" | ||
}, | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"skip": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"saslContinue" | ||
], | ||
"closeConnection": true, | ||
"appName": "poolCheckOutErrorCheckInTest" | ||
} | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"label": "conn" | ||
}, | ||
{ | ||
"name": "start", | ||
"target": "thread1" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"thread": "thread1" | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionCheckOutFailed", | ||
"count": 1 | ||
}, | ||
{ | ||
"name": "checkIn", | ||
"connection": "conn" | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckOutStarted" | ||
}, | ||
{ | ||
"type": "ConnectionCreated" | ||
}, | ||
{ | ||
"type": "ConnectionReady" | ||
}, | ||
{ | ||
"type": "ConnectionCheckedOut" | ||
}, | ||
{ | ||
"type": "ConnectionCheckOutStarted" | ||
}, | ||
{ | ||
"type": "ConnectionCreated" | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared" | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"reason": "error", | ||
"connectionId": 2 | ||
}, | ||
{ | ||
"type": "ConnectionCheckOutFailed", | ||
"reason": "connectionError" | ||
}, | ||
{ | ||
"type": "ConnectionCheckedIn" | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"connectionId": 1, | ||
"reason": "stale" | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionPoolCreated", | ||
"ConnectionPoolReady" | ||
] | ||
} |
55 changes: 55 additions & 0 deletions
55
source/connection-monitoring-and-pooling/tests/cmap-format/pool-checkout-error-checkin.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
version: 1 | ||
style: integration | ||
description: checking in a connection after checkout fails closes connection | ||
runOn: | ||
- | ||
# Required for appName in fail point | ||
minServerVersion: "4.9.0" | ||
auth: true | ||
poolOptions: | ||
appName: &appName "poolCheckOutErrorCheckInTest" | ||
failPoint: | ||
configureFailPoint: failCommand | ||
# Skip the first so that the first checkOut succeeds. | ||
mode: { skip: 1 } | ||
data: | ||
# Use saslContinue so that monitor checks won't interfere with this failpoint. | ||
failCommands: ["saslContinue"] | ||
closeConnection: true | ||
appName: *appName | ||
operations: | ||
- name: ready | ||
- name: checkOut | ||
label: conn | ||
# Perform check out in another thread so the main thread can continue to | ||
# execute operations. | ||
- name: start | ||
target: thread1 | ||
- name: checkOut | ||
thread: thread1 | ||
# Wait for the check out to fail | ||
- name: waitForEvent | ||
event: ConnectionCheckOutFailed | ||
count: 1 | ||
- name: checkIn | ||
connection: conn | ||
events: | ||
- type: ConnectionCheckOutStarted | ||
- type: ConnectionCreated | ||
- type: ConnectionReady | ||
- type: ConnectionCheckedOut | ||
- type: ConnectionCheckOutStarted | ||
- type: ConnectionCreated | ||
- type: ConnectionPoolCleared | ||
- type: ConnectionClosed | ||
reason: error | ||
connectionId: 2 | ||
- type: ConnectionCheckOutFailed | ||
reason: connectionError | ||
- type: ConnectionCheckedIn | ||
- type: ConnectionClosed | ||
connectionId: 1 | ||
reason: stale | ||
ignore: | ||
- ConnectionPoolCreated | ||
- ConnectionPoolReady |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This notice and associated psuedocode was moved to the "Establishing a Connection" section above to avoid duplication with "Checking out a Connection". The requirement still remains.