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 transmission_interface tests by making them deterministic. (backport #1665) #1671

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 13, 2024

Fixes #1555

The transmission_interface tests would give non deterministic spurious failures. The non determinism was because tests were randomly generated using the system time to seed the random number generator. The spurious failures were due to occasionally occurring tiny rounding errors from floating point math.

By seeding the random number generator the tests become deterministic and we avoid the spurious failures.
Additionally, changing the order of some of the multiplications seems to reduce the rounding error.

Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

  1. Limited scope. Your PR should do one thing or one set of things. Avoid adding “random fixes” to PRs. Put those on separate PRs.
  2. Give your PR a descriptive title. Add a short summary, if required.
  3. Make sure the pipeline is green.
  4. Don’t be afraid to request reviews from maintainers.
  5. New code = new tests. If you are adding new functionality, always make sure to add some tests exercising the code and serving as live documentation of your original intention.

To send us a pull request, please:

  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

This is an automatic backport of pull request #1665 done by [Mergify](https://mergify.com).

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.45%. Comparing base (ae2ed7c) to head (31221b9).
Report is 15 commits behind head on iron.

Additional details and impacted files
@@            Coverage Diff             @@
##             iron    #1671      +/-   ##
==========================================
- Coverage   87.45%   87.45%   -0.01%     
==========================================
  Files         101      101              
  Lines        8078     8081       +3     
  Branches      711      711              
==========================================
+ Hits         7065     7067       +2     
- Misses        717      718       +1     
  Partials      296      296              
Flag Coverage Δ
unittests 87.45% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ission_interface/four_bar_linkage_transmission.hpp 78.57% <100.00%> (ø)
...smission_interface/test/random_generator_utils.hpp 100.00% <100.00%> (ø)

@bmagyar bmagyar merged commit 5526f54 into iron Aug 14, 2024
11 of 12 checks passed
@bmagyar bmagyar deleted the mergify/bp/iron/pr-1665 branch August 14, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants