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

Mock the current time for network_interface_asio_test

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.0-rc2
    • Affects Version/s: None
    • Component/s: Networking
    • None
    • Fully Compatible
    • ALL
    • Platforms 2016-10-31
    • 0

      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.

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

              Created:
              Updated:
              Resolved: