You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* **NOTE:** Node emits a command failed event for writeConcern errors, making the commandSucceeded part of this test inconsistent see (DRIVERS-2468).
234
+
* Second our event emitters are called synchronously but operations are asynchronous, we don't have a way to make sure a fail point is set before a retry
235
+
* is attempted, if the server allowed us to specify an ordered list of fail points this would be possible, alas we can use sinon. Sinon will set an error
236
+
* to be thrown on the first and second call to Server.command(), this should enter the retry logic for the second error thrown.
237
+
*
238
+
* This test MUST be implemented by any driver that implements the Command Monitoring specification,
239
+
* only run against replica sets as mongos does not propagate the NoWritesPerformed label to the drivers.
240
+
* Additionally, this test requires drivers to set a fail point after an insertOne operation but before the subsequent retry.
241
+
* 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.
242
+
*
243
+
* Create a client with retryWrites=true.
244
+
*
245
+
* Configure a fail point with error code 91 (ShutdownInProgress):
246
+
* ```js
247
+
* db.adminCommand({
248
+
* configureFailPoint: 'failCommand',
249
+
* mode: { times: 1 },
250
+
* data: {
251
+
* writeConcernError: {
252
+
* code: 91,
253
+
* errorLabels: ['RetryableWriteError']
254
+
* },
255
+
* failCommands: ['insert']
256
+
* }
257
+
* });
258
+
* ```
259
+
* Via the command monitoring CommandSucceededEvent, configure a fail point with error code 10107 (NotWritablePrimary) and a NoWritesPerformed label:
0 commit comments