From 0c4d4d5d597e187825dc3b2c183fcebc63bb3bd3 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Sun, 29 Dec 2024 20:40:40 -0800 Subject: [PATCH] Mitigate test flakiness Signed-off-by: methylDragon --- .../test_always_insert_never_prune_policy_with_move_group.cpp | 4 ++-- .../test_best_seen_execution_time_policy_with_move_group.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moveit_ros/trajectory_cache/test/cache_insert_policies/test_always_insert_never_prune_policy_with_move_group.cpp b/moveit_ros/trajectory_cache/test/cache_insert_policies/test_always_insert_never_prune_policy_with_move_group.cpp index 8afd72fb4b..078e3c8f28 100644 --- a/moveit_ros/trajectory_cache/test/cache_insert_policies/test_always_insert_never_prune_policy_with_move_group.cpp +++ b/moveit_ros/trajectory_cache/test/cache_insert_policies/test_always_insert_never_prune_policy_with_move_group.cpp @@ -149,14 +149,14 @@ TEST_F(MoveGroupFixture, AlwaysInsertNeverPrunePolicyWorks) ASSERT_TRUE(move_group_->setPoseTarget(move_group_->getRandomPose())); move_group_->constructMotionPlanRequest(msg); ret = move_group_->plan(plan); - } while (!ret && plan.trajectory.joint_trajectory.points.empty()); // Sometimes the plan fails with the random pose. + } while (!ret || plan.trajectory.joint_trajectory.points.empty()); // Sometimes the plan fails with the random pose. do { ASSERT_TRUE(move_group_->setPoseTarget(move_group_->getRandomPose())); move_group_->constructMotionPlanRequest(another_msg); another_ret = move_group_->plan(another_plan); - } while (another_msg == msg && !another_ret && + } while (another_msg == msg || !another_ret || another_plan.trajectory.joint_trajectory.points .empty()); // Also, sometimes the random pose happens to be the same. diff --git a/moveit_ros/trajectory_cache/test/cache_insert_policies/test_best_seen_execution_time_policy_with_move_group.cpp b/moveit_ros/trajectory_cache/test/cache_insert_policies/test_best_seen_execution_time_policy_with_move_group.cpp index 815b0c4b91..b6110a2cab 100644 --- a/moveit_ros/trajectory_cache/test/cache_insert_policies/test_best_seen_execution_time_policy_with_move_group.cpp +++ b/moveit_ros/trajectory_cache/test/cache_insert_policies/test_best_seen_execution_time_policy_with_move_group.cpp @@ -149,14 +149,14 @@ TEST_F(MoveGroupFixture, BestSeenExecutionTimePolicyWorks) ASSERT_TRUE(move_group_->setPoseTarget(move_group_->getRandomPose())); move_group_->constructMotionPlanRequest(msg); ret = move_group_->plan(plan); - } while (!ret && plan.trajectory.joint_trajectory.points.empty()); // Sometimes the plan fails with the random pose. + } while (!ret || plan.trajectory.joint_trajectory.points.empty()); // Sometimes the plan fails with the random pose. do { ASSERT_TRUE(move_group_->setPoseTarget(move_group_->getRandomPose())); move_group_->constructMotionPlanRequest(another_msg); another_ret = move_group_->plan(another_plan); - } while (another_msg == msg && !another_ret && + } while (another_msg == msg || !another_ret || another_plan.trajectory.joint_trajectory.points .empty()); // Also, sometimes the random pose happens to be the same.