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

Fix flaky transform test #220

Merged
merged 1 commit into from
Jun 12, 2023
Merged

Fix flaky transform test #220

merged 1 commit into from
Jun 12, 2023

Conversation

nahueespinosa
Copy link
Member

@nahueespinosa nahueespinosa commented Jun 12, 2023

Proposed changes

The test added in #212 turned out to be flaky.

The failure rate is ~20% and can be evaluated with this command:

$ ./build/beluga_amcl/test/test_amcl_node --gtest_repeat=1000 --gtest_filter=TestNode.TransformValue 2> /dev/null | grep "1 FAILED" | wc -l
189

The error looks like this:

/ws/src/beluga/beluga_amcl/test/test_amcl_node.cpp:877: Failure
The difference between transform.translation().x() and -2.00 is 0.010270443192699208, which exceeds 0.01, where
transform.translation().x() evaluates to -2.0102704431926992,
-2.00 evaluates to -2, and
0.01 evaluates to 0.01.
/ws/src/beluga/beluga_amcl/test/test_amcl_node.cpp:878: Failure
The difference between transform.translation().y() and -2.00 is 0.01017702160925138, which exceeds 0.01, where
transform.translation().y() evaluates to -1.9898229783907486,
-2.00 evaluates to -2, and
0.01 evaluates to 0.01.

After this change, we get 0% failure rate:

$ ./build/beluga_amcl/test/test_amcl_node --gtest_repeat=1000 --gtest_filter=TestNode.TransformValue 2> /dev/null | grep "1 FAILED" | wc -l
0

Type of change

  • 🐛 Bugfix (change which fixes an issue)
  • 🚀 Feature (change which adds functionality)
  • 📚 Documentation (change which fixes or extends documentation)

Checklist

  • Lint and unit tests (if any) pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All commits have been signed for DCO

Signed-off-by: Nahuel Espinosa <nespinosa@ekumenlabs.com>
@nahueespinosa nahueespinosa added bug Something isn't working cpp Related to C++ code labels Jun 12, 2023
@nahueespinosa nahueespinosa self-assigned this Jun 12, 2023
Copy link
Collaborator

@glpuga glpuga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nahueespinosa nahueespinosa merged commit 068824e into main Jun 12, 2023
7 checks passed
@nahueespinosa nahueespinosa deleted the nahuel/fix-flaky-test branch June 12, 2023 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cpp Related to C++ code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants