-
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
base: master
Are you sure you want to change the base?
Changes from 20 commits
61886cb
f0b33d8
fc6544f
a2e2c1e
143963c
9187634
423cca6
d31abde
72f5bbd
471b39f
88426d0
91b4d9c
55bf35a
0be3db6
7f9ad15
81e3f94
ccee026
d721af2
4d28ee3
b1c7f02
dbb8b67
aa0d7ae
bec7969
82521a3
3c0d6a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ Introduction | |
Drivers MUST implement all of the following types of CMAP tests: | ||
|
||
* Pool unit and integration tests as described in `cmap-format/README.rst <./cmap-format/README.rst>`__ | ||
* Integration tests written in the `Unified Test Format <../../unified-test-format/unified-test-format.rst>`_ located in the `/unified <./unified>`_ directory | ||
* Pool prose tests as described below in `Prose Tests`_ | ||
* Logging tests as described below in `Logging Tests`_ | ||
|
||
Prose Tests | ||
=========== | ||
|
@@ -26,11 +26,4 @@ The following tests have not yet been automated, but MUST still be tested: | |
#. All ConnectionPoolOptions MUST be the same for all pools created by a MongoClient | ||
#. A user MUST be able to specify all ConnectionPoolOptions via a URI string | ||
#. A user MUST be able to subscribe to Connection Monitoring Events in a manner idiomatic to their language and driver | ||
#. When a check out attempt fails because connection set up throws an error, | ||
assert that a ConnectionCheckOutFailedEvent with reason="connectionError" is emitted. | ||
|
||
Logging Tests | ||
============= | ||
|
||
Tests for connection pool logging can be found in the `/logging <./logging>`__ subdirectory and are written in the | ||
`Unified Test Format <../../unified-test-format/unified-test-format.rst>`__. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this intentionally removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, the logging and new unified tests were combined into a single |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"version": 1, | ||
"style": "integration", | ||
"description": "must properly handle auth error on check out", | ||
"runOn": [ | ||
{ | ||
"minServerVersion": "4.9.0", | ||
"auth": true | ||
} | ||
], | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"saslContinue" | ||
], | ||
"appName": "poolCheckOutAuthErrorTest", | ||
"errorCode": 18 | ||
} | ||
}, | ||
"poolOptions": { | ||
"appName": "poolCheckOutAuthErrorTest" | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "checkOut" | ||
} | ||
], | ||
"error": { | ||
"type": "AuthenticationError" | ||
}, | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckOutStarted", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionCreated", | ||
"connectionId": 1, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"connectionId": 1, | ||
"address": 42, | ||
"reason": "error" | ||
}, | ||
{ | ||
"type": "ConnectionCheckOutFailed", | ||
"connectionId": 1, | ||
"address": 42, | ||
BorisDog marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"reason": "connectionError" | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionPoolCreated", | ||
"ConnectionPoolReady" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
version: 1 | ||
style: integration | ||
description: must properly handle auth error on check out | ||
runOn: | ||
- | ||
# required for appName in fail point | ||
minServerVersion: "4.9.0" | ||
auth: true | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: ["saslContinue"] | ||
appName: &appName "poolCheckOutAuthErrorTest" | ||
errorCode: 18 | ||
poolOptions: | ||
appName: *appName | ||
operations: | ||
- name: ready | ||
- name: checkOut | ||
error: | ||
type: AuthenticationError | ||
events: | ||
- type: ConnectionCheckOutStarted | ||
address: 42 | ||
- type: ConnectionCreated | ||
connectionId: 1 | ||
address: 42 | ||
- type: ConnectionPoolCleared | ||
address: 42 | ||
- type: ConnectionClosed | ||
connectionId: 1 | ||
address: 42 | ||
reason: error | ||
- type: ConnectionCheckOutFailed | ||
connectionId: 1 | ||
address: 42 | ||
reason: connectionError | ||
ignore: | ||
- ConnectionPoolCreated | ||
- ConnectionPoolReady |
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" | ||
] | ||
} |
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.