mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-28 15:50:26 +08:00
6dadd492b8
ProcStatReader.Threads is flaky because it relies on an internal, imprecise measurement of boot time. The flaky test asserts that a thread started after the main thread should have a start time >= the main thread. The start time is returned in a timeval, with microsecond precision, but the measurement of boot time requires two system calls and the time between those system calls can be approximately a microsecond. An unlucky event such as a change in system time could make this imprecision arbitrarily bad. This patch lets the caller of ProcStatReader.StartTime() inject the boot time, allowing ProcStatReader to guarantee that threads have correctly ordered time, given the same input boot time. Bug: 1016765 Change-Id: I6e4a944a1d58c3916090bab6a4b99573e71a89fc Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1891588 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Joshua Peraza <jperaza@chromium.org>