Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: util/misc/clock_test.cc

Issue 640373003: util_test Clock.SleepNanoseconds: don’t set an upper bound for the amount of time spent sleeping (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/clock_test.cc
diff --git a/util/misc/clock_test.cc b/util/misc/clock_test.cc
index 8082e951d3ae2c838c91da67e53858f9d31d9292..ffc5e4943a260c1f374c615ef2713275d5ea64f7 100644
--- a/util/misc/clock_test.cc
+++ b/util/misc/clock_test.cc
@@ -61,12 +61,8 @@ void TestSleepNanoseconds(uint64_t nanoseconds) {
// sleeping.
EXPECT_GE(diff, nanoseconds);
- // It’s difficult to set an upper bound for the time spent sleeping. Allow
- // sleeps twice as long as requested, or sleeps a millisecond longer than
- // requested, whichever is larger. This is quite a lot of slop, but the
- // alternative would be test flakiness.
- uint64_t slop = std::max(static_cast<uint64_t>(1E6), nanoseconds);
- EXPECT_LE(diff, nanoseconds + slop);
+ // It’s difficult to set an upper bound for the time spent sleeping, and
+ // attempting to do so results in a flaky test.
}
TEST(Clock, SleepNanoseconds) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698