summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 18:29:20 +0000
committerjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-08 18:29:20 +0000
commit95afaf602277edfc45d2ed37100d8f1f91b609fa (patch)
tree302b9eaed0b577f0fa67449033b2e508dc057f69
parent9602d040b8a0bdb25a67ac20c0f2a11cb4e86553 (diff)
downloadchromium_src-95afaf602277edfc45d2ed37100d8f1f91b609fa.zip
chromium_src-95afaf602277edfc45d2ed37100d8f1f91b609fa.tar.gz
chromium_src-95afaf602277edfc45d2ed37100d8f1f91b609fa.tar.bz2
Significantly increase timeouts to reduce flakiness
Several tests now "plan for success" and will terminate rapidly if all goes well (and will hang if there really is a problem). One test I just upped by a factor of 5, hoping that I'll get a timem slice within a 5 second window, rather than assuming that I'll get one within a 1 second window. I could go further, but the test now takes over 5 seconds to run, which seems like a lot of time for a trivial test. bug=5723 r=maruel Review URL: http://codereview.chromium.org/16495 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7744 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/watchdog_unittest.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/base/watchdog_unittest.cc b/base/watchdog_unittest.cc
index 00e82e3..9f8bf7b 100644
--- a/base/watchdog_unittest.cc
+++ b/base/watchdog_unittest.cc
@@ -73,15 +73,14 @@ TEST(WatchdogTest, ArmDisarmTest) {
TEST(WatchdogTest, AlarmTest) {
WatchdogCounter watchdog(TimeDelta::FromMilliseconds(10), "Enabled", true);
watchdog.Arm();
- SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromSeconds(1),
+ SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(5),
watchdog.alarm_counter() > 0);
EXPECT_EQ(1, watchdog.alarm_counter());
// Set a time greater than the timeout into the past.
watchdog.ArmSomeTimeDeltaAgo(TimeDelta::FromSeconds(2));
- // It should instantly go off, but certainly in less than a second.
- // In practice, on our trybots, it sometimes takes a little longer!
- SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMilliseconds(1500),
+ // It should instantly go off, but certainly in less than 5 minutes.
+ SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(5),
watchdog.alarm_counter() > 1);
EXPECT_EQ(2, watchdog.alarm_counter());
@@ -98,19 +97,19 @@ TEST(WatchdogTest, ConstructorDisabledTest) {
// Make sure Disarming will prevent firing, even after Arming.
TEST(WatchdogTest, DisarmTest) {
- WatchdogCounter watchdog(TimeDelta::FromSeconds(1), "Enabled", true);
+ WatchdogCounter watchdog(TimeDelta::FromSeconds(5), "Enabled", true);
watchdog.Arm();
PlatformThread::Sleep(100); // Don't sleep too long
watchdog.Disarm();
// Alarm should not fire.
- PlatformThread::Sleep(1500);
+ PlatformThread::Sleep(5500);
EXPECT_EQ(0, watchdog.alarm_counter());
// ...but even after disarming, we can still use the alarm...
// Set a time greater than the timeout into the past.
watchdog.ArmSomeTimeDeltaAgo(TimeDelta::FromSeconds(2));
- // It should almost instantly go off, but certainly in less than a second.
- SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromSeconds(1),
+ // It should almost instantly go off, but certainly in less than 5 minutes.
+ SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromMinutes(5),
watchdog.alarm_counter() > 0);
EXPECT_EQ(1, watchdog.alarm_counter());