-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
Repl 2019-11-18
-
12
In the "ReportStashedState" and "ReportUnstashedState" unit tests inside session_test.cpp, startWallClockTime value may not be strictly greater than or equal to startTime since the former is measured using curTimeMicros64() and the latter using Date_t::now() which use different clock sources. If the "real" (i.e. absolute) time is, for example, 4.6 milliseconds, then curTimeMicros64() may return 4600, but we would round it down to 4 milliseconds. At the same time, Date_t::now() may return 5 milliseconds, since it is lower precision. So, we may see startTime actually be greater than startWallClockTime. This is just a discrepancy in the unit tests, and not important for how we track these stats in a real system. To prevent this issue in the tests, we can add artificial sleeps to the unit tests after we record startTime but before we record the startWallClockTime value.
- related to
-
SERVER-45761 Use same clock for test and working code in session_test [v4.0]
- Closed