Make CollectionShardingRuntime CriticalSectionMetricsReportWaiters test resilient to slow thread scheduling

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0, 8.3.5
    • Affects Version/s: 9.0.0-rc0, 8.3.0
    • Component/s: Catalog, Sharding
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.3
    • CAR Team 2026-06-22
    • 200
    • 🟦 Shard Catalog
    • None
    • None
    • None
    • None
    • None
    • None

      The CriticalSectionMetricsReportWaiters unit test is flaky because, after one of the test threads starts sleeping for 20ms, the other thread has to get scheduled within a 10ms window to start capturing the statistics. Otherwise the assertion that the thread waited for at least 10ms fails.

       

      The test should be fixed to not assume the OS will schedule the threads in a particular way.

            Assignee:
            Joan Bruguera Micó
            Reporter:
            Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: