Skip to content

Commit a6ea2eb

Browse files
authored
DRIVERS-3355: Fix Backpressure-related racy tests (#1867)
1 parent 3e577e8 commit a6ea2eb

8 files changed

+130
-151
lines changed

source/logging/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Drivers MUST support configuring where log messages should be output, including
9595
> - If the value is "stdout" (case-insensitive), log to stdout.
9696
> - If the value is "stderr" (case-insensitive), log to stderr.
9797
> - Else, if direct logging to files is supported, log to a file at the specified path. If the file already exists, it
98-
> MUST be appended to.
98+
> MUST be appended to.
9999
>
100100
> If the variable is not provided or is set to an invalid value (which could be invalid for any reason, e.g. the path
101101
> does not exist or is not writeable), the driver MUST log to stderr and the driver MAY attempt to warn the user about

source/server-discovery-and-monitoring/server-discovery-and-monitoring-tests.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ clear event. We create a setup client to enable the ingress connection establish
180180
connection storm. After the storm, we verify that some of the connections failed to checkout, but that the pool was not
181181
cleared.
182182

183-
This test requires MongoDB 7.0+.
183+
This test requires MongoDB 7.0+. See the
184+
[MongoDB Server Parameters](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.ingressConnectionEstablishmentRateLimiterEnabled)
185+
for more details.
184186

185187
1. Create a test client that listens to CMAP events, with maxConnecting=100. The higher maxConnecting will help ensure
186188
contention for creating connections.
@@ -205,7 +207,9 @@ This test requires MongoDB 7.0+.
205207

206208
6. Assert that 0 `PoolClearedEvent` occurred.
207209

208-
7. Sleep for 1 second to clear the rate limiter.
210+
7. Ensure that the following steps run at test teardown even if the test fails:
209211

210-
8. Ensure that the following command runs at test teardown even if the test fails.
212+
7.1. Sleep for 1 second to clear the rate limiter.
213+
214+
7.2. Execute the following command:
211215
`client.admin("setParameter", 1, ingressConnectionEstablishmentRateLimiterEnabled=False)`.

source/server-discovery-and-monitoring/tests/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/server-discovery-and-monitoring/tests/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ createEntities:
1212
tests:
1313
- description: the server description is not changed on handshake error during minPoolSize population
1414
operations:
15+
- name: failPoint
16+
object: testRunner
17+
arguments:
18+
client: setupClient
19+
failPoint:
20+
configureFailPoint: failCommand
21+
mode:
22+
skip: 1
23+
data:
24+
failCommands:
25+
- hello
26+
- isMaster
27+
appName: authErrorTest
28+
closeConnection: true
1529
- name: createEntities
1630
object: testRunner
1731
arguments:
@@ -27,20 +41,6 @@ tests:
2741
maxConnecting: 1
2842
serverMonitoringMode: poll
2943
heartbeatFrequencyMS: 1000000
30-
- name: failPoint
31-
object: testRunner
32-
arguments:
33-
client: setupClient
34-
failPoint:
35-
configureFailPoint: failCommand
36-
mode:
37-
skip: 1
38-
data:
39-
failCommands:
40-
- hello
41-
- isMaster
42-
appName: authErrorTest
43-
closeConnection: true
4444
- name: waitForEvent
4545
object: testRunner
4646
arguments:

source/server-discovery-and-monitoring/tests/unified/minPoolSize-error.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/server-discovery-and-monitoring/tests/unified/minPoolSize-error.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ initialData: &initialData
2121
documents: []
2222

2323
tests:
24-
- description: Network error on minPoolSize background creation
24+
- description: Server error on minPoolSize background creation
2525
operations:
2626
# Configure the initial monitor handshake to succeed but the
2727
# first or second background minPoolSize establishments to fail.
@@ -38,7 +38,7 @@ tests:
3838
- hello
3939
- isMaster
4040
appName: SDAMminPoolSizeError
41-
closeConnection: true
41+
errorCode: 91
4242
- name: createEntities
4343
object: testRunner
4444
arguments:
@@ -54,6 +54,7 @@ tests:
5454
heartbeatFrequencyMS: 10000
5555
appname: SDAMminPoolSizeError
5656
minPoolSize: 10
57+
serverMonitoringMode: poll
5758
serverSelectionTimeoutMS: 1000
5859
- database:
5960
id: &database database

source/server-discovery-and-monitoring/tests/unified/pool-clear-min-pool-size-error.json

Lines changed: 45 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)