Skip to content

Commit

Permalink
Remove flaky spin test that needs to be rewritten (ros-navigation#4348)
Browse files Browse the repository at this point in the history
* remove spin test that is failing reliably

* cont.
  • Loading branch information
SteveMacenski authored May 16, 2024
1 parent 5acdb4f commit bf291d7
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions nav2_system_tests/src/behaviors/spin/test_spin_behavior_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit bf291d7

Please sign in to comment.