avoid truncation in test timeouts

XMLWordPrintableJSON

    • Networking & Observability
    • Fully Compatible
    • N&O 2026-03-16
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This is an attempt at fixing BF-41982, which I have not yet reproduced.

      The test failure is always one millisecond less than the expected lower bound

      src/mongo/executor/network_interface_integration_test.cpp:885: Failure
      Expected: (duration_cast<Milliseconds>(result.elapsed.value()) + createRequestDelay) >= (requestTimeout), actual: 599ms vs 600ms

      I notice that a recent adjustment adds an additional delay, but casts to milliseconds before adding the additional delay. This shouldn't matter, since the value has millisecond precision. But now there are two places where truncating a time interval down to the nearest millisecond could introduce error, and the resulting total error might now sometimes add up to a millisecond.

      Remove the unnecessary duration_cast calls from network_interface_integration_test, and use a higher precision timer.

      Maybe that will fix BF-41982.

            Assignee:
            David Goffredo
            Reporter:
            David Goffredo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: