Details
Description
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:
139
|
// getMore should time out if we insert a non-matching document.
|
140
|
let insertshell = startParallelShell(function() { |
141
|
assert.soon(function() { |
142
|
return db.currentOp({op: "getmore", "command.collection": "await_data"}) |
143
|
.inprog.length == 1;
|
144
|
});
|
145
|
assert.writeOK(db.await_data.insert({x: 0}));
|
146
|
}, mongo.port);
|
147
|
|
148
|
now = new Date(); |
149
|
cmdRes = db.runCommand({getMore: cmdRes.cursor.id, collection: collName, maxTimeMS: 4000});
|
150
|
assert.commandWorked(cmdRes);
|
151
|
assert.gt(cmdRes.cursor.id, NumberLong(0));
|
152
|
assert.eq(cmdRes.cursor.ns, coll.getFullName());
|
153
|
assert.eq(cmdRes.cursor.nextBatch.length, 0);
|
154
|
assert.gte((new Date()) - now, |
155
|
// SERVER-31502 Add some leniency here since our server-side wait may be woken up |
156
|
// spuriously. |
157
|
3900,
|
158
|
"Insert not matching filter caused awaitData getMore to return prematurely."); |
159
|
insertshell();
|