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

Mock the current time for network_interface_asio_test

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.4.0-rc2
    • Networking
    • None
    • Fully Compatible
    • ALL
    • Platforms 2016-10-31
    • 0

    Description

      Right now, NetworkInterfaceASIO::now() relies on Date_t::now(). For our tests, we rely on having a precise control on time (e.g. see AsyncOpTimeout test). However, before we start a timer, NIA alters the timeout to reflect the amount of time that passed since starting the connection. When looking at an unstable wall clock, this can cause a hang when the test expects advancing time by exactly 1001ms to always cancel an operation that had a timeout of 1000ms.

      The solution is to add a ::now() method to the async timer factory interface.

      Attachments

        Activity

          People

            matt.cotter Matt Cotter
            matt.cotter Matt Cotter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: