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
Some command-started events in ``expectations`` include ``null`` values for
298
+
optional fields such as ``allowDiskUse``.
299
+
Tests MUST assert that the actual command **omits** any field that has a
300
+
``null`` value in the expected command.
301
+
289
302
Optional Fields in Expected Result Objects
290
303
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
304
@@ -294,3 +307,35 @@ specification, such as ``insertedId`` (for InsertOneResult), ``insertedIds``
294
307
(for InsertManyResult), and ``upsertedCount`` (for UpdateResult). Drivers that
295
308
do not implement these fields should ignore them when comparing ``actual`` with
296
309
``expected``.
310
+
311
+
Prose Tests
312
+
===========
313
+
314
+
The following tests have not yet been automated, but MUST still be tested.
315
+
316
+
"errInfo" is propagated
317
+
-----------------------
318
+
Test that a writeConcernError "errInfo" is propagated to the user in whatever way is idiomatic to the driver (exception, error object, etc.). Using a 4.0+ server, set the following failpoint:
319
+
320
+
.. code:: javascript
321
+
322
+
{
323
+
"configureFailPoint":"failCommand",
324
+
"data": {
325
+
"failCommands": ["insert"],
326
+
"writeConcernError": {
327
+
"code":100,
328
+
"codeName":"UnsatisfiableWriteConcern",
329
+
"errmsg":"Not enough data-bearing nodes",
330
+
"errInfo": {
331
+
"writeConcern": {
332
+
"w":2,
333
+
"wtimeout":0,
334
+
"provenance":"clientSupplied"
335
+
}
336
+
}
337
+
}
338
+
},
339
+
"mode": { "times":1 }
340
+
}
341
+
Then, perform an insert on the same database. Assert that an error occurs and that the "errInfo" is accessible and matches the one set in the failpoint.
0 commit comments