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

Make `ConnectionPoolHistogramStats` tests resilient to timing issues on Windows

    • Service Arch
    • Fully Compatible
    • ALL
    • v8.0
    • Service Arch 2023-04-17, Service Arch 2023-05-01, Service Arch 2024-04-15
    • 5
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The test injects a 60 milliseconds delay in the connection establishment path to verify that connection establishment histograms are updated properly.

      TEST_F(ConnectionPoolTest, ConnectionPoolHistogramStats) {
          using namespace unittest::match;
      
          RAIIServerParameterControllerForTest controller("featureFlagConnHealthMetrics", true);
          FailPointEnableBlock fp("injectWaitTimeForConnpoolAcquisition", BSON("sleepTimeMillis" << 60));
      ...
      

      The test was designed to not require accurate time measurements, as it accepts any value between 50 to 150 ms. However, timing inaccuracies on Windows are larger than the test currently accounts for. To fix the issue, we should either skip running the test on Windows, or make it more resilient to timing issues.

            Assignee:
            joseph.prince@mongodb.com Joseph Prince
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: