Skip to content

Commit 0984b09

Browse files
authored
DRIVERS-716 skip bulkWrite tests on Atlas Serverless (#1636)
* add `serverless: forbid` to spec tests using `clientBulkWrite` * skip prose tests usingn `MongoClient.bulkWrite` on Atlas Serverless * add Q&A entry to spec * increase `schemaVersion` to 1.4 To include support for `serverless` as a `runOnRequirement` * regenerate test files
1 parent 8be1189 commit 0984b09

36 files changed

+94
-49
lines changed

source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/command-logging-and-monitoring/tests/monitoring/unacknowledged-client-bulkWrite.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ schemaVersion: "1.7"
44

55
runOnRequirements:
66
- minServerVersion: "8.0"
7+
serverless: forbid
78

89
createEntities:
910
- client:

source/crud/bulk-write.md

+4
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,10 @@ the initial implementation and testing of the new bulk write API, but may be rev
781781

782782
## Q&A
783783

784+
### Is `bulkWrite` supported on Atlas Serverless?
785+
786+
No. See [CLOUDP-256344](https://jira.mongodb.org/browse/CLOUDP-256344)
787+
784788
### Why are we adding a new bulk write API rather than updating the `MongoCollection.bulkWrite` implementation?
785789

786790
The new `bulkWrite` command is only available in MongoDB 8.0+, so it cannot function as a drop-in replacement for the

source/crud/tests/README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ WriteError's `details` property.
7070
Test that `MongoClient.bulkWrite` properly handles `writeModels` inputs containing a number of writes greater than
7171
`maxWriteBatchSize`.
7272

73-
This test must only be run on 8.0+ servers.
73+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
7474

7575
Construct a `MongoClient` (referred to as `client`) with
7676
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -98,7 +98,7 @@ command. Assert that the length of `firstEvent.command.ops` is `maxWriteBatchSiz
9898
Test that `MongoClient.bulkWrite` properly handles a `writeModels` input which constructs an `ops` array larger than
9999
`maxMessageSizeBytes`.
100100

101-
This test must only be run on 8.0+ servers.
101+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
102102

103103
Construct a `MongoClient` (referred to as `client`) with
104104
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -137,7 +137,7 @@ driver exposes `operationId`s in its CommandStartedEvents, assert that `firstEve
137137

138138
Test that `MongoClient.bulkWrite` properly collects and reports `writeConcernError`s returned in separate batches.
139139

140-
This test must only be run on 8.0+ servers.
140+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
141141

142142
Construct a `MongoClient` (referred to as `client`) with `retryWrites: false` configured and
143143
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -182,7 +182,7 @@ Assert that two CommandStartedEvents were observed for the `bulkWrite` command.
182182

183183
Test that `MongoClient.bulkWrite` handles individual write errors across batches for ordered and unordered bulk writes.
184184

185-
This test must only be run on 8.0+ servers.
185+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
186186

187187
Construct a `MongoClient` (referred to as `client`) with
188188
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -237,7 +237,7 @@ Assert that one CommandStartedEvent was observed for the `bulkWrite` command.
237237

238238
Test that `MongoClient.bulkWrite` properly iterates the results cursor when `getMore` is required.
239239

240-
This test must only be run on 8.0+ servers.
240+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
241241

242242
Construct a `MongoClient` (referred to as `client`) with
243243
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -276,7 +276,8 @@ Assert that a CommandStartedEvent was observed for the `getMore` command.
276276
Test that `MongoClient.bulkWrite` executed within a transaction properly iterates the results cursor when `getMore` is
277277
required.
278278

279-
This test must only be run on 8.0+ servers. This test must not be run against standalone servers.
279+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless. This test must not be run
280+
against standalone servers.
280281

281282
Construct a `MongoClient` (referred to as `client`) with
282283
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -318,7 +319,7 @@ Assert that a CommandStartedEvent was observed for the `getMore` command.
318319

319320
Test that `MongoClient.bulkWrite` properly handles a failure that occurs when attempting a `getMore`.
320321

321-
This test must only be run on 8.0+ servers.
322+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
322323

323324
Construct a `MongoClient` (referred to as `client`) with
324325
[command monitoring](../../command-logging-and-monitoring/command-logging-and-monitoring.rst) enabled to observe
@@ -369,7 +370,7 @@ Assert that a CommandStartedEvent was observed for the `killCursors` command.
369370

370371
### 10. `MongoClient.bulkWrite` returns error for unacknowledged too-large insert
371372

372-
This test must only be run on 8.0+ servers.
373+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
373374

374375
Construct a `MongoClient` (referred to as `client`).
375376

@@ -423,7 +424,7 @@ Expect a client-side error due the size.
423424
Test that `MongoClient.bulkWrite` batch splits a bulk write when the addition of a new namespace to `nsInfo` causes the
424425
size of the message to exceed `maxMessageSizeBytes - 1000`.
425426

426-
This test must only be run on 8.0+ servers.
427+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
427428

428429
Repeat the following setup for each test case:
429430

@@ -603,8 +604,8 @@ remainingBulkWriteBytes = maxMessageSizeBytes - 1122
603604
Test that `MongoClient.bulkWrite` returns an error if an operation provided exceeds `maxMessageSizeBytes` such that an
604605
empty `ops` payload would be sent.
605606

606-
This test must only be run on 8.0+ servers. This test may be skipped by drivers that are not able to construct
607-
arbitrarily large documents.
607+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless. This test may be skipped by
608+
drivers that are not able to construct arbitrarily large documents.
608609

609610
Construct a `MongoClient` (referred to as `client`). Perform a `hello` command using `client` and record the
610611
`maxMessageSizeBytes` value contained in the response.
@@ -649,7 +650,7 @@ This test is expected to be removed when [DRIVERS-2888](https://jira.mongodb.org
649650

650651
Test that `MongoClient.bulkWrite` returns an error if the client has auto-encryption configured.
651652

652-
This test must only be run on 8.0+ servers.
653+
This test must only be run on 8.0+ servers. This test must be skipped on Atlas Serverless.
653654

654655
Construct a `MongoClient` (referred to as `client`) configured with the following `AutoEncryptionOpts`:
655656

source/crud/tests/unified/client-bulkWrite-delete-options.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-delete-options.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite delete options"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-errorResponse.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-errorResponse.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ description: "client bulkWrite errorResponse"
22
schemaVersion: "1.12"
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-errors.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-errors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ description: "client bulkWrite errors"
22
schemaVersion: "1.21"
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-mixed-namespaces.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-mixed-namespaces.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite with mixed namespaces"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-options.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-options.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite top-level options"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-ordered.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-ordered.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite with ordered option"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-results.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-results.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite results"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-update-options.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-update-options.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite update options"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/crud/tests/unified/client-bulkWrite-update-pipeline.json

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/client-bulkWrite-update-pipeline.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
description: "client bulkWrite update pipeline"
2-
schemaVersion: "1.1"
2+
schemaVersion: "1.4" # To support `serverless: forbid`
33
runOnRequirements:
44
- minServerVersion: "8.0"
5+
serverless: forbid
56

67
createEntities:
78
- client:

source/retryable-writes/tests/etc/templates/handshakeError.yml.template

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
description: "retryable writes handshake failures"
44

5-
schemaVersion: "1.3"
5+
schemaVersion: "1.4" # For `serverless: forbid`
66

77
runOnRequirements:
88
- minServerVersion: "4.2"
@@ -54,6 +54,7 @@ tests:
5454
{%- if (operation.operation_name == 'clientBulkWrite') %}
5555
runOnRequirements:
5656
- minServerVersion: "8.0" # `bulkWrite` added to server 8.0
57+
serverless: forbid
5758
{%- endif %}
5859
operations:
5960
- name: failPoint
@@ -102,6 +103,7 @@ tests:
102103
{%- if (operation.operation_name == 'clientBulkWrite') %}
103104
runOnRequirements:
104105
- minServerVersion: "8.0" # `bulkWrite` added to server 8.0
106+
serverless: forbid
105107
{%- endif %}
106108
operations:
107109
- name: failPoint

source/retryable-writes/tests/unified/client-bulkWrite-clientErrors.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/retryable-writes/tests/unified/client-bulkWrite-clientErrors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ runOnRequirements:
66
- replicaset
77
- sharded
88
- load-balanced
9+
serverless: forbid
910

1011
createEntities:
1112
- client:

source/retryable-writes/tests/unified/client-bulkWrite-serverErrors.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/retryable-writes/tests/unified/client-bulkWrite-serverErrors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ runOnRequirements:
66
- replicaset
77
- sharded
88
- load-balanced
9+
serverless: forbid
910

1011
createEntities:
1112
- client:

0 commit comments

Comments
 (0)