Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
588f1f2
initial commit
baileympearson Nov 25, 2025
e467f5b
new files
baileympearson Nov 26, 2025
d55fdb9
add tests for handshake changes
baileympearson Nov 26, 2025
8e74b41
add generated tests
baileympearson Dec 1, 2025
072b453
test fixes and add prose test
baileympearson Dec 1, 2025
52e2a35
fix run on requirements
baileympearson Dec 2, 2025
391c951
fix run on requirements?
baileympearson Dec 2, 2025
92501c0
fix CI
baileympearson Dec 2, 2025
0fdef39
comments
baileympearson Dec 3, 2025
82acab8
Fix broken unified tests
baileympearson Dec 3, 2025
b3a7b6c
fix UTR linting failures
baileympearson Dec 3, 2025
60a87b8
remove broken deleteMany() from unified tests
baileympearson Dec 3, 2025
399a56b
add backwards compat section
baileympearson Dec 10, 2025
0545e15
Jeff's and Jib's comments
baileympearson Dec 11, 2025
ff5475a
adjust backpressure spec phrasing to make it clear retryable errors a…
baileympearson Dec 11, 2025
6211624
squash: jeremy's casing comments
baileympearson Dec 11, 2025
c1001bc
squash: other comments
baileympearson Dec 11, 2025
def5fbd
squash: other comments
baileympearson Dec 11, 2025
08da5c4
last round comments
baileympearson Dec 11, 2025
034b85e
unified retry loop, handshake phrasing change
baileympearson Dec 15, 2025
779e171
Jeremy's last comments
baileympearson Dec 15, 2025
e5d4de6
Other misc comments
baileympearson Dec 16, 2025
1cd95fc
update transaction spec and add unified tests
blink1073 Dec 17, 2025
6912e45
update transaction logic and add more tests
blink1073 Dec 17, 2025
88e6067
verify commitTransaction fails after 5 backoff attempts
blink1073 Dec 18, 2025
2019678
clean up transactions spec
blink1073 Dec 18, 2025
d3ce32b
update test names
blink1073 Dec 18, 2025
de7e862
address writeconcern on retries
blink1073 Dec 18, 2025
ab85a5b
add retryable get more tests
baileympearson Dec 18, 2025
eb10ddb
transaction test fixes
baileympearson Dec 18, 2025
2b90697
deduplicate ids
baileympearson Dec 18, 2025
0abf373
update transaction writeconcern logic and add changelog entry
blink1073 Dec 18, 2025
d07d49e
last few comments
baileympearson Dec 18, 2025
747c18c
add runOnRequirement for getMore tests
blink1073 Dec 19, 2025
be27bc0
updated formula
baileympearson Dec 19, 2025
92e479a
Merge branch 'master' of github.com:mongodb/specifications into DRIVE…
blink1073 Dec 22, 2025
b674f13
lint
blink1073 Dec 22, 2025
03065ad
address review
blink1073 Dec 23, 2025
1b7f6df
fix link
blink1073 Dec 23, 2025
eac90fc
first round of comments addressed
baileympearson Jan 5, 2026
0533acc
second round of comments addressed
baileympearson Jan 6, 2026
629aec9
Update source/client-backpressure/client-backpressure.md
baileympearson Jan 7, 2026
9e4ad70
Update source/client-backpressure/client-backpressure.md
baileympearson Jan 7, 2026
d4d0b38
jermery's comments - formatting of yml files and prose test description
baileympearson Jan 8, 2026
530e727
Valentin's comments
baileympearson Jan 9, 2026
c31f486
Comments pt 2
baileympearson Jan 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
369 changes: 369 additions & 0 deletions source/client-backpressure/client-backpressure.md

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions source/client-backpressure/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Client Backpressure Tests

______________________________________________________________________

## Introduction

The YAML and JSON files in this directory are platform-independent tests meant to exercise a driver's implementation of
retryable reads. These tests utilize the [Unified Test Format](../../unified-test-format/unified-test-format.md).

Several prose tests, which are not easily expressed in YAML, are also presented in this file. Those tests will need to
be manually implemented by each driver.

### Prose Tests

#### Test 1: Operation Retry Uses Exponential Backoff

Drivers should test that retries do not occur immediately when a SystemOverloadedError is encountered.

1. Let `client` be a `MongoClient`
2. Let `collection` be a collection
3. Now, run transactions without backoff:
1. Configure the random number generator used for jitter to always return `0` -- this effectively disables backoff.

2. Configure the following failPoint:

```javascript
{
configureFailPoint: 'failCommand',
mode: 'alwaysOn',
data: {
failCommands: ['insert'],
errorCode: 2,
errorLabels: ['SystemOverloadedError', 'RetryableError']
}
}
```

3. Insert the document `{ a: 1 }`. Expect that the command errors. Measure the duration of the command execution.

```javascript
const start = performance.now();
expect(
await coll.insertOne({ a: 1 }).catch(e => e)
).to.be.an.instanceof(MongoServerError);
const end = performance.now();
```

4. Configure the random number generator used for jitter to always return `1`.

5. Execute step 3 again.

6. Compare the two time between the two runs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the following lines should all appear under element six. If so, indentation is needed (check preview).


```python
assertTrue(with_backoff_time - no_backoff_time >= 2.1)
```

The sum of 5 backoffs is 3.1 seconds. There is a 1-second window to account for potential variance between the two
runs.
Loading
Loading