From f9d319bac0304abead178df7b03d6b5531601864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Fri, 14 Jun 2019 16:43:01 +0000 Subject: [PATCH] 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 --- xpcom/tests/gtest/TestThreadMetrics.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xpcom/tests/gtest/TestThreadMetrics.cpp b/xpcom/tests/gtest/TestThreadMetrics.cpp index 244e2344a3ca..94af61df9598 100644 --- a/xpcom/tests/gtest/TestThreadMetrics.cpp +++ b/xpcom/tests/gtest/TestThreadMetrics.cpp @@ -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); }