[SERVER-39603] Robustify max_time_ms_sharded.js Created: 15/Feb/19  Updated: 29/Oct/23  Resolved: 20/Feb/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, JavaScript, Querying, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.1.9

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 40

 Description   

In recent test runs on some of our slowest test infrastructure (the variant which collects code coverage), this assertion has been failing:

max_time_ms_sharded.js:97

87
    // Positive test. ~10s operation, 2s limit. The operation takes ~10s because each shard
88
    // processes 25 batches of ~400ms each, and the shards are processing getMores in parallel.
89
    cursor = coll.find({
90
        $where: function() {
91
            sleep(200);
92
            return true;
93
        }
94
    });
95
    cursor.batchSize(2);
96
    cursor.maxTimeMS(2 * 1000);
97
    assert.doesNotThrow(
98
        () => cursor.next(), [], "did not expect mongos to time out first batch of query");
99
    assert.throws(() => cursor.itcount(), [], "expected mongos to abort getmore due to time limit");

We can write a more robust test case which verifies the same thing, so we should do so.



 Comments   
Comment by Githook User [ 20/Feb/19 ]

Author:

{'name': 'Charlie Swanson', 'username': 'cswanson310', 'email': 'charlie.swanson@mongodb.com'}

Message: SERVER-39603 Robustify max_time_ms_sharded.js
Branch: master
https://github.com/mongodb/mongo/commit/41c2a1022b845846fea3cf9d172ab83c79c09532

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