Bug 1558882 - Fixed intermittent on ThreadMetrics.CollectMetrics r=erahm
authorTarek Ziadé <tarek@mozilla.com>
Fri, 14 Jun 2019 16:43:01 +0000
changeset 478905 12d826365c0c5009e025728bca75829227f5ceab
parent 478904 ffde2ba5b8c65039dea5d8de24ea9af111c35713
child 478906 15bac42cc73ad22b97dfcb4cae9645ab2bc213e5
push id113443
push userdvarga@mozilla.com
push dateFri, 14 Jun 2019 21:53:52 +0000
treeherdermozilla-inbound@14f3762c1f70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1558882
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1558882 - Fixed intermittent on ThreadMetrics.CollectMetrics r=erahm The first test does not really need to check that we spend less than 200ms, and we can give more time to the scheduler in the second test, as long as we check that is less than the recursive dispatched event Differential Revision: https://phabricator.services.mozilla.com/D34988
xpcom/tests/gtest/TestThreadMetrics.cpp
--- a/xpcom/tests/gtest/TestThreadMetrics.cpp
+++ b/xpcom/tests/gtest/TestThreadMetrics.cpp
@@ -144,27 +144,26 @@ TEST_F(ThreadMetrics, CollectMetrics) {
     if (i != mOther) {
       ASSERT_EQ(mCounter->GetDispatchCounter()[i], 0u);
     }
   }
 
   // Did we get incremented in the docgroup ?
   uint64_t duration = mCounter->GetExecutionDuration();
   ASSERT_GE(duration, 50000u);
-  ASSERT_LT(duration, 200000u);
 }
 
 TEST_F(ThreadMetrics, CollectRecursiveMetrics) {
   nsresult rv;
 
   initScheduler();
 
   // Dispatching a runnable that will last for +50ms
-  // and run another one recursively that lasts for 200ms
-  rv = Dispatch(25, 25, 200);
+  // and run another one recursively that lasts for 400ms
+  rv = Dispatch(25, 25, 400);
   ASSERT_TRUE(NS_SUCCEEDED(rv));
 
   // Flush the queue
   ProcessAllEvents();
 
   // let's look at the counters
   ASSERT_EQ(mCounter->GetDispatchCounter()[mOther], 1u);
 
@@ -175,10 +174,10 @@ TEST_F(ThreadMetrics, CollectRecursiveMe
     }
   }
 
   // did we get incremented in the docgroup ?
   uint64_t duration = mCounter->GetExecutionDuration();
   ASSERT_GE(duration, 50000u);
 
   // let's make sure we don't count the time spent in recursive calls
-  ASSERT_LT(duration, 200000u);
+  ASSERT_LT(duration, 300000u);
 }