Skip to content

Commit 7374c43

Browse files
authored
Increase the max and min periodicity tolerances to fix flaky tests (#1937)
1 parent bb087e2 commit 7374c43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

controller_manager/test/test_controller_manager.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,11 +607,11 @@ TEST_P(TestControllerManagerWithUpdateRates, per_controller_equal_and_higher_upd
607607
EXPECT_THAT(
608608
cm_->get_loaded_controllers()[0].periodicity_statistics->Min(),
609609
testing::AllOf(
610-
testing::Ge(0.85 * cm_->get_update_rate()), testing::Lt((1.2 * cm_->get_update_rate()))));
610+
testing::Ge(0.75 * cm_->get_update_rate()), testing::Lt((1.2 * cm_->get_update_rate()))));
611611
EXPECT_THAT(
612612
cm_->get_loaded_controllers()[0].periodicity_statistics->Max(),
613613
testing::AllOf(
614-
testing::Ge(0.85 * cm_->get_update_rate()), testing::Lt((1.2 * cm_->get_update_rate()))));
614+
testing::Ge(0.75 * cm_->get_update_rate()), testing::Lt((2.0 * cm_->get_update_rate()))));
615615
loop_rate.sleep();
616616
}
617617
// 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)
778778
testing::AllOf(testing::Ge(0.95 * exp_periodicity), testing::Lt((1.05 * exp_periodicity))));
779779
EXPECT_THAT(
780780
cm_->get_loaded_controllers()[0].periodicity_statistics->Min(),
781-
testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity))));
781+
testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((1.2 * exp_periodicity))));
782782
EXPECT_THAT(
783783
cm_->get_loaded_controllers()[0].periodicity_statistics->Max(),
784-
testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity))));
784+
testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((2.0 * exp_periodicity))));
785785
EXPECT_LT(
786786
cm_->get_loaded_controllers()[0].execution_time_statistics->Average(),
787787
50.0); // 50 microseconds
@@ -924,10 +924,10 @@ TEST_F(TestAsyncControllerUpdateRates, check_the_async_controller_update_rate_an
924924
testing::AllOf(testing::Ge(0.95 * exp_periodicity), testing::Lt((1.05 * exp_periodicity))));
925925
EXPECT_THAT(
926926
cm_->get_loaded_controllers()[0].periodicity_statistics->Min(),
927-
testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity))));
927+
testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((1.2 * exp_periodicity))));
928928
EXPECT_THAT(
929929
cm_->get_loaded_controllers()[0].periodicity_statistics->Max(),
930-
testing::AllOf(testing::Ge(0.85 * exp_periodicity), testing::Lt((1.2 * exp_periodicity))));
930+
testing::AllOf(testing::Ge(0.75 * exp_periodicity), testing::Lt((2.0 * exp_periodicity))));
931931
EXPECT_LT(
932932
cm_->get_loaded_controllers()[0].execution_time_statistics->Average(),
933933
12000); // more or less 12 milliseconds considering the waittime in the controller

0 commit comments

Comments
 (0)