[SERVER-26662] Mock the current time for network_interface_asio_test Created: 17/Oct/16 Updated: 31/Oct/16 Resolved: 26/Oct/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.0-rc2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matt Cotter | Assignee: | Matt Cotter |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Platforms 2016-10-31 | ||||
| Participants: | |||||
| Linked BF Score: | 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. |
| Comments |
| Comment by Githook User [ 26/Oct/16 ] |
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message: This way when the timer factory is mocked, the network interface's `now` |