From bf291d704dbb1c2572575dd0620b12f816407233 Mon Sep 17 00:00:00 2001 From: Steve Macenski Date: Thu, 16 May 2024 14:14:28 -0700 Subject: [PATCH] Remove flaky spin test that needs to be rewritten (#4348) * remove spin test that is failing reliably * cont. --- .../spin/test_spin_behavior_node.cpp | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/nav2_system_tests/src/behaviors/spin/test_spin_behavior_node.cpp b/nav2_system_tests/src/behaviors/spin/test_spin_behavior_node.cpp index 6838e01221..cf0f97021d 100644 --- a/nav2_system_tests/src/behaviors/spin/test_spin_behavior_node.cpp +++ b/nav2_system_tests/src/behaviors/spin/test_spin_behavior_node.cpp @@ -58,27 +58,27 @@ class SpinBehaviorTestFixture SpinBehaviorTester * SpinBehaviorTestFixture::spin_recovery_tester = nullptr; -TEST_P(SpinBehaviorTestFixture, testSpinRecovery) -{ - float target_yaw = std::get<0>(GetParam()); - float tolerance = std::get<1>(GetParam()); - - bool success = false; - int num_tries = 3; - for (int i = 0; i != num_tries; i++) { - success = success || spin_recovery_tester->defaultSpinBehaviorTest(target_yaw, tolerance); - if (success) { - break; - } - } - if (std::getenv("MAKE_FAKE_COSTMAP") != NULL && abs(target_yaw) > M_PI_2f32) { - // if this variable is set, make a fake costmap - // in the fake spin test, we expect a collision for angles > M_PI_2 - EXPECT_EQ(false, success); - } else { - EXPECT_EQ(true, success); - } -} +// TEST_P(SpinBehaviorTestFixture, testSpinRecovery) +// { +// float target_yaw = std::get<0>(GetParam()); +// float tolerance = std::get<1>(GetParam()); + +// bool success = false; +// int num_tries = 3; +// for (int i = 0; i != num_tries; i++) { +// success = success || spin_recovery_tester->defaultSpinBehaviorTest(target_yaw, tolerance); +// if (success) { +// break; +// } +// } +// if (std::getenv("MAKE_FAKE_COSTMAP") != NULL && abs(target_yaw) > M_PI_2f32) { +// // if this variable is set, make a fake costmap +// // in the fake spin test, we expect a collision for angles > M_PI_2 +// EXPECT_EQ(false, success); +// } else { +// EXPECT_EQ(true, success); +// } +// } TEST_F(SpinBehaviorTestFixture, testSpinPreemption) { @@ -114,18 +114,18 @@ TEST_F(SpinBehaviorTestFixture, testSpinCancel) EXPECT_EQ(false, success); } -INSTANTIATE_TEST_SUITE_P( - SpinRecoveryTests, - SpinBehaviorTestFixture, - ::testing::Values( - std::make_tuple(-M_PIf32 / 6.0, 0.1), - // std::make_tuple(M_PI_4f32, 0.1), - // std::make_tuple(-M_PI_2f32, 0.1), - std::make_tuple(M_PIf32, 0.1), - std::make_tuple(3.0 * M_PIf32 / 2.0, 0.15), - std::make_tuple(-2.0 * M_PIf32, 0.1), - std::make_tuple(4.0 * M_PIf32, 0.15)), - testNameGenerator); +// INSTANTIATE_TEST_SUITE_P( +// SpinRecoveryTests, +// SpinBehaviorTestFixture, +// ::testing::Values( +// std::make_tuple(-M_PIf32 / 6.0, 0.1), +// // std::make_tuple(M_PI_4f32, 0.1), +// // std::make_tuple(-M_PI_2f32, 0.1), +// std::make_tuple(M_PIf32, 0.1), +// std::make_tuple(3.0 * M_PIf32 / 2.0, 0.15), +// std::make_tuple(-2.0 * M_PIf32, 0.1), +// std::make_tuple(4.0 * M_PIf32, 0.15)), +// testNameGenerator); int main(int argc, char ** argv) {