From 7c79eafa36fc1884a451024a5b3937da562ff948 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Thu, 12 Dec 2024 12:45:15 +0100 Subject: [PATCH] Increase the max and min periodicity tolerances to fix flaky tests --- controller_manager/test/test_controller_manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/controller_manager/test/test_controller_manager.cpp b/controller_manager/test/test_controller_manager.cpp index b715bc23dc..49c02d28ac 100644 --- a/controller_manager/test/test_controller_manager.cpp +++ b/controller_manager/test/test_controller_manager.cpp @@ -607,11 +607,11 @@ TEST_P(TestControllerManagerWithUpdateRates, per_controller_equal_and_higher_upd EXPECT_THAT( cm_->get_loaded_controllers()[0].periodicity_statistics->Min(), testing::AllOf( - testing::Ge(0.85 * cm_->get_update_rate()), testing::Lt((1.2 * cm_->get_update_rate())))); + testing::Ge(0.75 * cm_->get_update_rate()), testing::Lt((1.2 * cm_->get_update_rate())))); EXPECT_THAT( cm_->get_loaded_controllers()[0].periodicity_statistics->Max(), testing::AllOf( - testing::Ge(0.85 * cm_->get_update_rate()), testing::Lt((1.2 * cm_->get_update_rate())))); + testing::Ge(0.75 * cm_->get_update_rate()), testing::Lt((2.0 * cm_->get_update_rate())))); loop_rate.sleep(); } // if we do 2 times of the controller_manager update rate, the internal counter should be @@ -778,10 +778,10 @@ TEST_P(TestControllerUpdateRates, check_the_controller_update_rate) testing::AllOf(testing::Ge(0.95 * exp_periodicity), testing::Lt((1.05 * exp_periodicity)))); EXPECT_THAT( cm_->get_loaded_controllers()[0].periodicity_statistics->Min(), - testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity)))); + testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((1.2 * exp_periodicity)))); EXPECT_THAT( cm_->get_loaded_controllers()[0].periodicity_statistics->Max(), - testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity)))); + testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((2.0 * exp_periodicity)))); EXPECT_LT( cm_->get_loaded_controllers()[0].execution_time_statistics->Average(), 50.0); // 50 microseconds @@ -924,10 +924,10 @@ TEST_F(TestAsyncControllerUpdateRates, check_the_async_controller_update_rate_an testing::AllOf(testing::Ge(0.95 * exp_periodicity), testing::Lt((1.05 * exp_periodicity)))); EXPECT_THAT( cm_->get_loaded_controllers()[0].periodicity_statistics->Min(), - testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity)))); + testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((1.2 * exp_periodicity)))); EXPECT_THAT( cm_->get_loaded_controllers()[0].periodicity_statistics->Max(), - testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity)))); + testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((2.0 * exp_periodicity)))); EXPECT_LT( cm_->get_loaded_controllers()[0].execution_time_statistics->Average(), 12000); // more or less 12 milliseconds considering the waittime in the controller