[SERVER-22837] Fix flakiness in jstests/sharding/cursor1.js Created: 24/Feb/16  Updated: 20/Nov/16  Resolved: 24/Feb/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.2.10, 3.3.3

Type: Task Priority: Minor - P4
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: test-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Query 11 (03/14/16)
Participants:
Linked BF Score: 0

 Description   

This test is fundamentally racy. It opens a cursor, turns down the cursor timeout to 10 seconds, sleeps 6 seconds, then verifies that the cursor still exists. If it takes more than 10 seconds for the test to reach the check that the cursor still exists, mongos could have already timed-out and reaped the cursor.

Instead, the test should turn down the cursor timeout to a small value (1 second should do), and then use assert.soon() to poll mongos until the cursor gets reaped. This is a much less flaky way to perform the intended test that mongos eventually times out cursors.



 Comments   
Comment by Githook User [ 23/Sep/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-22837 fix flakiness in jstests/sharding/cursor1.js
Branch: v3.2
https://github.com/mongodb/mongo/commit/3103bba2a6250f54af065b55763fef7e9e0b49ea

Comment by Spencer Brody (Inactive) [ 21/Sep/16 ]

This test is still flaky on 3.2 branch, we should backport the fixes

Comment by Githook User [ 24/Feb/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-22837 fix flakiness in jstests/sharding/cursor1.js
Branch: master
https://github.com/mongodb/mongo/commit/35414b817da18dd07450691e28acdc074135f945

Generated at Thu Feb 08 04:01:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.