Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-34857

`sharding_legacy_api_test` is flaky due to reliance on the system clock

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.7.9
    • 3.6.6, 4.0.0-rc0
    • Sharding
    • None
    • Fully Compatible
    • ALL
    • v3.6
    • Sharding 2018-05-21
    • 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.

      Attachments

        Issue Links

          Activity

            People

              kaloian.manassiev@mongodb.com Kaloian Manassiev
              kaloian.manassiev@mongodb.com Kaloian Manassiev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: