fuchsia: Increase timeout for WorkerThread.DoWork test

Because of Fuchsia's scheduler the seemingly reasonable time check fails
occasionally.

Bug: crashpad:196, crashpad:231
Change-Id: Ic212a50e73e283ce3d279dd8c28adecbc432e39c
Reviewed-on: https://chromium-review.googlesource.com/1055805
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Scott Graham 2018-05-11 11:54:42 -07:00 committed by Commit Bot
parent ef6d91b166
commit 9115494e8a

View File

@ -71,7 +71,18 @@ TEST(WorkerThread, DoWork) {
thread.Stop();
EXPECT_FALSE(thread.is_running());
EXPECT_GE(1 * kNanosecondsPerSecond, ClockMonotonicNanoseconds() - start);
// Fuchsia's scheduler is very antagonistic. The assumption that the two work
// items complete in some particular amount of time is strictly incorrect, but
// also somewhat useful. The expected time "should" be ~40-50ms with a work
// interval of 0.05s, but on Fuchsia, 1200ms was observed. So, on Fuchsia, use a
// much larger timeout. See https://crashpad.chromium.org/bug/231.
#if defined(OS_FUCHSIA)
constexpr uint64_t kUpperBoundTime = 10;
#else
constexpr uint64_t kUpperBoundTime = 1;
#endif
EXPECT_GE(kUpperBoundTime * kNanosecondsPerSecond,
ClockMonotonicNanoseconds() - start);
}
TEST(WorkerThread, StopBeforeDoWork) {