-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
ALL
-
v5.0, v4.4, v4.2, v4.0
-
24
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
The waitForCursor function acts as a barrier in the mentioned test by querying currentOp to determine if the cursor has been established. It uses the following expression to determine this:
function waitForShardCursor(rs) { assert.soon(() => rs.getPrimary() .getDB('admin') .aggregate([ {"$currentOp": {"idleCursors": true}}, {"$match": {ns: mongosColl.getFullName(), type: "idleCursor"}} ]) .itcount() === 1); }
In failing runs, this function exits early meaning that some other code has established an idle cursor according to the criteria above. We should change the test so that the condition is strong enough to only consider the cursor established in the test.