Skip to content

Commit

Permalink
Increase the max and min periodicity tolerances to fix flaky tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor authored Dec 13, 2024
1 parent bb087e2 commit 7374c43
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controller_manager/test/test_controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7374c43

Please sign in to comment.