Bug 1298602 - split condition in TestExpirationTracker; r=KrisWright, a=test-only
authorNathan Froyd <froydnj@mozilla.com>
Wed, 31 Jul 2019 18:16:35 +0000
changeset 545081 c94a36ea1b116213a4dfc4086ffd7b7a94457ac6
parent 545080 36fd0189859eac2b945c03a518af4df2abde637c
child 545082 c1cad7515d96c90f1def64b21ba2de19e2f52fcf
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersKrisWright, test-only
bugs1298602
milestone69.0
Bug 1298602 - split condition in TestExpirationTracker; r=KrisWright, a=test-only This condition is intermittently failing, but it's hard to tell from the failure which part of the condition is failing. Split the condition apart so ideally we'll get some better error messages. While we're doing that, use a more explicit `EXPECT_LT` for the first half of the condition for even better error messages. Differential Revision: https://phabricator.services.mozilla.com/D40051
xpcom/tests/gtest/TestExpirationTracker.cpp
--- a/xpcom/tests/gtest/TestExpirationTracker.cpp
+++ b/xpcom/tests/gtest/TestExpirationTracker.cpp
@@ -127,17 +127,18 @@ class Tracker : public nsExpirationTrack
     // bounds
     uint32_t lowerBoundMS = (K - 1) * periodMS - lowerBoundSlackMS;
     uint32_t upperBoundMS = K * (periodMS + sleepPeriodMS) + upperBoundSlackMS;
     if (logging) {
       printf("Checking: %d-%d = %d [%d,%d]\n", now, aObj->mLastUsed, timeDiffMS,
              lowerBoundMS, upperBoundMS);
     }
     if (timeDiffMS < lowerBoundMS || timeDiffMS > upperBoundMS) {
-      EXPECT_TRUE(timeDiffMS < periodMS && aObj->mExpired);
+      EXPECT_LT(timeDiffMS, periodMS);
+      EXPECT_TRUE(aObj->mExpired);
     }
     aObj->Touch();
     aObj->mExpired = true;
     DoRandomOperation();
     DoRandomOperation();
     DoRandomOperation();
   }
 };