[SERVER-34857] `sharding_legacy_api_test` is flaky due to reliance on the system clock Created: 04/May/18  Updated: 29/Oct/23  Resolved: 07/May/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.7.9
Fix Version/s: 3.6.6, 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-50460 Use a mockable time source for shard_... Backlog
related to SERVER-51471 Make `sharding_legacy_api_test` resil... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Sprint: Sharding 2018-05-21
Participants:
Linked BF Score: 50

 Description   

The test creates new connections and tries to differentiate them from older collections using the creation timestamp. This all happens on a single thread and there is no concurrency.

From looking at the logs and from comparing to a successful run, it looks like the connections were created in the same microsecond, as returned by mongo::curTimeMicros64() and my suspicion is that on the machine where it ran, the clock resolution was not high enough for the test.

Since the test supports legacy functionality, we shouldn't spent too much time fixing it and should just add a sleep at the beginning of checkNewConns.

A more proper solution would be to use a MockTimeSource and explicitly control the time.



 Comments   
Comment by Githook User [ 29/May/18 ]

Author:

{'username': 'kaloianm', 'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-34857 Make `sharding_legacy_api_test` more robust

(cherry picked from commit 7f0c3802ccf7fe13fc3a96045646e4def9a4fa9e)
Branch: v3.6
https://github.com/mongodb/mongo/commit/3041cedfcc1446b76a5b9322ec51d490ba84f708

Comment by Githook User [ 07/May/18 ]

Author:

{'email': 'kaloian.manassiev@mongodb.com', 'name': 'Kaloian Manassiev', 'username': 'kaloianm'}

Message: SERVER-34857 Make `sharding_legacy_api_test` more robust
Branch: master
https://github.com/mongodb/mongo/commit/7f0c3802ccf7fe13fc3a96045646e4def9a4fa9e

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