Skip to content

Commit 49db2b1

Browse files
committed
revert unnecessary changes
1 parent e4b900f commit 49db2b1

1 file changed

Lines changed: 15 additions & 20 deletions

File tree

test/integration/retryable-writes/retryable_writes.spec.prose.test.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,40 +239,38 @@ describe('Retryable Writes Spec Prose', () => {
239239
* Additionally, this test requires drivers to set a fail point after an insertOne operation but before the subsequent retry.
240240
* Drivers that are unable to set a failCommand after the CommandSucceededEvent SHOULD use mocking or write a unit test to cover the same sequence of events.
241241
*
242-
* 1. Create a client with retryWrites=true.
242+
* Create a client with retryWrites=true.
243243
*
244-
* 2. Configure a fail point with error code `91` (ShutdownInProgress) with the `RetryableError` and
245-
* `SystemOverloadedError` error labels:
244+
* Configure a fail point with error code 91 (ShutdownInProgress):
246245
* ```js
247246
* db.adminCommand({
248247
* configureFailPoint: 'failCommand',
249248
* mode: { times: 1 },
250249
* data: {
250+
* writeConcernError: {
251+
* code: 91,
252+
* errorLabels: ['RetryableWriteError']
253+
* },
251254
* failCommands: ['insert']
252-
* errorLabels: ['RetryableError', 'SystemOverloadedError'],
253-
* errorCode: 91,
254255
* }
255256
* });
256257
* ```
257-
*
258-
* 3. Via the command monitoring CommandSucceededEvent, configure a fail point with error code `91` (ShutdownInProgress) and
259-
* the `NoWritesPerformed`, `RetryableError` and `SystemOverloadedError` labels:
258+
* Via the command monitoring CommandSucceededEvent, configure a fail point with error code 10107 (NotWritablePrimary) and a NoWritesPerformed label:
260259
*
261260
* ```js
262261
* db.adminCommand({
263262
* configureFailPoint: 'failCommand',
264-
* mode: 'alwaysOn',
263+
* mode: { times: 1 },
265264
* data: {
265+
* errorCode: 10107,
266+
* errorLabels: ['RetryableWriteError', 'NoWritesPerformed'],
266267
* failCommands: ['insert']
267-
* errorLabels: [ 'RetryableError', 'SystemOverloadedError', 'NoWritesPerformed'],
268-
* errorCode: 91,
269268
* }
270269
* });
271270
* ```
271+
* Drivers SHOULD only configure the 10107 fail point command if the the succeeded event is for the 91 error configured in step 2.
272272
*
273-
* Drivers SHOULD configure the second fail point command only if the event is for the first error configured in step 2.
274-
*
275-
* 4. Attempt an insertOne operation on any record for any database and collection. For the resulting error, assert that the associated error code is 91.
273+
* Attempt an insertOne operation on any record for any database and collection. For the resulting error, assert that the associated error code is 91.
276274
*/
277275
it(
278276
'when a retry attempt fails with an error labeled NoWritesPerformed, drivers MUST return the original error',
@@ -281,19 +279,16 @@ describe('Retryable Writes Spec Prose', () => {
281279
const serverCommandStub = sinon.stub(Server.prototype, 'command');
282280
serverCommandStub.onCall(0).rejects(
283281
new MongoWriteConcernError({
284-
// errorLabels: ['RetryableError', 'SystemOverloadedError'], // expected changes, tests fail
285-
errorLabels: ['RetryableWriteError'], // original, tests pass
282+
errorLabels: ['RetryableWriteError'],
286283
writeConcernError: { errmsg: 'ShutdownInProgress error', code: 91 },
287284
ok: 1
288285
})
289286
);
290287
serverCommandStub.onCall(1).returns(
291288
Promise.reject(
292289
new MongoWriteConcernError({
293-
errorLabels: ['RetryableWriteError', 'NoWritesPerformed'], // original, tests pass
294-
// errorLabels: ['RetryableError', 'SystemOverloadedError', 'NoWritesPerformed'], // expected changes, tests fail
295-
writeConcernError: { errmsg: 'NotWritablePrimary error', code: 91 }, // my changes
296-
ok: 1
290+
errorLabels: ['RetryableWriteError', 'NoWritesPerformed'],
291+
writeConcernError: { errmsg: 'NotWritablePrimary error', errorCode: 10107 }
297292
})
298293
)
299294
);

0 commit comments

Comments
 (0)