Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove flaky spin test that needs to be rewritten #4348

Merged
merged 2 commits into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading