awaitdata_getmore_cmd.js can encounter an assert.soon() failure in the following code if the time it takes to start the parallelShell exceeds the 4 second maxTimeMS set on the awaitData getMore:
// getMore should time out if we insert a non-matching document. let insertshell = startParallelShell(function() { assert.soon(function() { return db.currentOp({op: "getmore", "command.collection": "await_data"}) .inprog.length == 1; }); assert.writeOK(db.await_data.insert({x: 0})); }, mongo.port); now = new Date(); cmdRes = db.runCommand({getMore: cmdRes.cursor.id, collection: collName, maxTimeMS: 4000}); assert.commandWorked(cmdRes); assert.gt(cmdRes.cursor.id, NumberLong(0)); assert.eq(cmdRes.cursor.ns, coll.getFullName()); assert.eq(cmdRes.cursor.nextBatch.length, 0); assert.gte((new Date()) - now, // SERVER-31502 Add some leniency here since our server-side wait may be woken up // spuriously. 3900, "Insert not matching filter caused awaitData getMore to return prematurely."); insertshell();