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

Make node scanner tests more deterministic #526

Conversation

erlend-aasland
Copy link
Contributor

It seems sending and receiving on the same virtual bus1 is flaky. My initial assumption that the flakiness was caused by unordered messages was thus incorrect2.

After fiddling around with this a couple of evenings, I get stable CI runs by using two separate virtual can.Bus instances; one for the object we're testing ("TX bus"), and one for validating what's being sent ("RX bus"). We might want to follow this strategy for other parts of the test suite as well. I vaguely remember earlier issues when using receive_own_messages=True and repeated bus.recv polling.

Footnotes

  1. can.Bus(interface="virtual", receive_own_messages=True)

  2. ... which is pretty obvious when you browse through the python-can source code

@erlend-aasland
Copy link
Contributor Author

FTR, this fixes up the tests added with commit d1c28e5 (gh-517).

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.37%. Comparing base (ecf216a) to head (da12858).
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #526      +/-   ##
==========================================
+ Coverage   70.17%   70.37%   +0.19%     
==========================================
  Files          26       26              
  Lines        3112     3112              
  Branches      526      526              
==========================================
+ Hits         2184     2190       +6     
+ Misses        800      794       -6     
  Partials      128      128              

see 1 file with indirect coverage changes

@acolomb acolomb merged commit d75c5f0 into christiansandberg:master Aug 11, 2024
3 checks passed
@erlend-aasland erlend-aasland deleted the tests/harden-node-scanner-test branch August 11, 2024 21:10
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