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

Unified Diff: base/watchdog.cc

Issue 42147: Increase fudge factor to let WatchdogTest.AlarmTest pass reliably on slower m... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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: base/watchdog.cc
===================================================================
--- base/watchdog.cc (revision 11556)
+++ base/watchdog.cc (working copy)
@@ -109,7 +109,10 @@
TimeTicks last_alarm_time = TimeTicks::Now();
watchdog_->Alarm(); // Set a break point here to debug on alarms.
TimeDelta last_alarm_delay = TimeTicks::Now() - last_alarm_time;
- if (last_alarm_delay > TimeDelta::FromMilliseconds(2)) {
+ // Normally, a threshold of 2ms works here, but 10x higher
+ // threshold needed to reliably pass WatchdogTest.AlarmTest
+ // under valgrind on an old 3.4GHz Pentium 4. Use 15x for margin.
+ if (last_alarm_delay > TimeDelta::FromMilliseconds(30)) {
// Ignore race of two alarms/breaks going off at roughly the same time.
AutoLock static_lock(static_lock_);
// This was a real debugger break.
« 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