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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tarek Ziadé 2019-06-14 16:43:01 +00:00
parent e3c1f07198
commit f9d319bac0

View File

@ -149,7 +149,6 @@ TEST_F(ThreadMetrics, CollectMetrics) {
// Did we get incremented in the docgroup ?
uint64_t duration = mCounter->GetExecutionDuration();
ASSERT_GE(duration, 50000u);
ASSERT_LT(duration, 200000u);
}
TEST_F(ThreadMetrics, CollectRecursiveMetrics) {
@ -158,8 +157,8 @@ TEST_F(ThreadMetrics, CollectRecursiveMetrics) {
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
@ -180,5 +179,5 @@ TEST_F(ThreadMetrics, CollectRecursiveMetrics) {
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);
}