-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(NODE-7470): test that backpressure retries are non-blocking #4891
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
Merged
PavelSafronov
merged 4 commits into
main
from
NODE-7470/test-backpressure-retries-are-nonblocking
Mar 20, 2026
+216
−10
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1b14e86
test: backpressure retries are non-blocking
dariakp e798fd8
Merge branch 'main' into NODE-7470/test-backpressure-retries-are-nonb…
tadjik1 6a0af2b
unpin the session when a SystemOverloadedError occurs
tadjik1 a6e7f88
check the aspect Aspect.CURSOR_CREATING to prevent breaking cursor pi…
tadjik1 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
129 changes: 129 additions & 0 deletions
129
test/spec/client-backpressure/backpressure-connection-checkin.json
This file contains hidden or 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,129 @@ | ||
| { | ||
| "description": "tests that connections are returned to the pool on retry attempts for overload errors", | ||
| "schemaVersion": "1.3", | ||
| "runOnRequirements": [ | ||
| { | ||
| "minServerVersion": "4.4", | ||
| "topologies": [ | ||
| "replicaset", | ||
| "sharded", | ||
| "load-balanced" | ||
| ] | ||
| } | ||
| ], | ||
| "createEntities": [ | ||
| { | ||
| "client": { | ||
| "id": "client", | ||
| "useMultipleMongoses": false, | ||
| "observeEvents": [ | ||
| "connectionCheckedOutEvent", | ||
| "connectionCheckedInEvent" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "client": { | ||
| "id": "fail_point_client", | ||
| "useMultipleMongoses": false | ||
| } | ||
| }, | ||
| { | ||
| "database": { | ||
| "id": "database", | ||
| "client": "client", | ||
| "databaseName": "backpressure-connection-checkin" | ||
| } | ||
| }, | ||
| { | ||
| "collection": { | ||
| "id": "collection", | ||
| "database": "database", | ||
| "collectionName": "coll" | ||
| } | ||
| } | ||
| ], | ||
| "tests": [ | ||
| { | ||
| "description": "overload error retry attempts return connections to the pool", | ||
| "operations": [ | ||
| { | ||
| "name": "failPoint", | ||
| "object": "testRunner", | ||
| "arguments": { | ||
| "client": "fail_point_client", | ||
| "failPoint": { | ||
| "configureFailPoint": "failCommand", | ||
| "mode": "alwaysOn", | ||
| "data": { | ||
| "failCommands": [ | ||
| "find" | ||
| ], | ||
| "errorLabels": [ | ||
| "RetryableError", | ||
| "SystemOverloadedError" | ||
| ], | ||
| "errorCode": 2 | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "name": "find", | ||
| "object": "collection", | ||
| "arguments": { | ||
| "filter": {} | ||
| }, | ||
| "expectError": { | ||
| "isError": true, | ||
| "isClientError": false | ||
| } | ||
| } | ||
| ], | ||
| "expectEvents": [ | ||
| { | ||
| "client": "client", | ||
| "eventType": "cmap", | ||
| "events": [ | ||
| { | ||
| "connectionCheckedOutEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedInEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedOutEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedInEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedOutEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedInEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedOutEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedInEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedOutEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedInEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedOutEvent": {} | ||
| }, | ||
| { | ||
| "connectionCheckedInEvent": {} | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
67 changes: 67 additions & 0 deletions
67
test/spec/client-backpressure/backpressure-connection-checkin.yml
This file contains hidden or 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,67 @@ | ||
| description: tests that connections are returned to the pool on retry attempts for overload errors | ||
| schemaVersion: "1.3" | ||
| runOnRequirements: | ||
| - minServerVersion: "4.4" | ||
| topologies: | ||
| - replicaset | ||
| - sharded | ||
| - load-balanced | ||
| createEntities: | ||
| - client: | ||
| id: client | ||
| useMultipleMongoses: false | ||
| observeEvents: | ||
| - connectionCheckedOutEvent | ||
| - connectionCheckedInEvent | ||
| - client: | ||
| id: fail_point_client | ||
| useMultipleMongoses: false | ||
| - database: | ||
| id: database | ||
| client: client | ||
| databaseName: backpressure-connection-checkin | ||
| - collection: | ||
| id: collection | ||
| database: database | ||
| collectionName: coll | ||
| tests: | ||
| - description: overload error retry attempts return connections to the pool | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: fail_point_client | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: alwaysOn | ||
| data: | ||
| failCommands: | ||
| - find | ||
| errorLabels: | ||
| - RetryableError | ||
| - SystemOverloadedError | ||
| errorCode: 2 | ||
| - name: find | ||
| object: collection | ||
| arguments: | ||
| filter: {} | ||
| expectError: | ||
| isError: true | ||
| isClientError: false | ||
| expectEvents: | ||
| - client: client | ||
| eventType: cmap | ||
| events: | ||
| - connectionCheckedOutEvent: {} | ||
| - connectionCheckedInEvent: {} | ||
| - connectionCheckedOutEvent: {} | ||
| - connectionCheckedInEvent: {} | ||
| - connectionCheckedOutEvent: {} | ||
| - connectionCheckedInEvent: {} | ||
| - connectionCheckedOutEvent: {} | ||
| - connectionCheckedInEvent: {} | ||
| - connectionCheckedOutEvent: {} | ||
| - connectionCheckedInEvent: {} | ||
| - connectionCheckedOutEvent: {} | ||
| - connectionCheckedInEvent: {} | ||
|
|
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.
Uh oh!
There was an error while loading. Please reload this page.