diff --git a/test/integration/retryable-writes/retryable_writes.spec.prose.test.ts b/test/integration/retryable-writes/retryable_writes.spec.prose.test.ts index 4edeb0ef28f..5f60712a1d9 100644 --- a/test/integration/retryable-writes/retryable_writes.spec.prose.test.ts +++ b/test/integration/retryable-writes/retryable_writes.spec.prose.test.ts @@ -490,33 +490,35 @@ describe('Retryable Writes Spec Prose', () => { 'Case 3: Test that drivers return the correct error when receiving some errors with NoWritesPerformed and some without NoWritesPerformed', { requires: { topology: 'replicaset', mongodb: '>=6.0' } }, async () => { - // 2. Configure the client to listen to CommandFailedEvents. In the attached listener, configure a fail point with error - // code `91` (NotWritablePrimary) and the `NoWritesPerformed`, `RetryableError` and `SystemOverloadedError` labels: + // 2. Configure a fail point with error code `91` (ShutdownInProgress) with the `RetryableError` and + // `SystemOverloadedError` error labels: // ```javascript // { // configureFailPoint: "failCommand", - // mode: "alwaysOn", + // mode: {times: 1}, // data: { // failCommands: ["insert"], - // errorLabels: ["RetryableError", "SystemOverloadedError", "NoWritesPerformed"], + // errorLabels: ["RetryableError", "SystemOverloadedError"], // errorCode: 91 // } // } // ``` - // 3. Configure a fail point with error code `91` (ShutdownInProgress) with the `RetryableError` and - // `SystemOverloadedError` error labels but without the `NoWritesPerformed` error label: + // 3. Via the command monitoring CommandFailedEvent, configure a fail point with error code `91` (ShutdownInProgress) and + // the `NoWritesPerformed`, `RetryableError` and `SystemOverloadedError` labels: // ```javascript // { // configureFailPoint: "failCommand", - // mode: {times: 1}, + // mode: "alwaysOn", // data: { // failCommands: ["insert"], - // errorLabels: ["RetryableError", "SystemOverloadedError"], + // errorLabels: ["RetryableError", "SystemOverloadedError", "NoWritesPerformed"], // errorCode: 91 // } // } // ``` + // Configure the second fail point command only if the failed event is for the first error configured in step 2. + const serverCommandStub = sinon .stub(Server.prototype, 'command') .callsFake(async function () {