Skip to content

Reduce MockedCANCoderTest Fail Rate - #82

Closed
CoolSpy3 wants to merge 1 commit into
2024-betafrom
patch-MockedCANCoderTest
Closed

Reduce MockedCANCoderTest Fail Rate#82
CoolSpy3 wants to merge 1 commit into
2024-betafrom
patch-MockedCANCoderTest

Conversation

@CoolSpy3

Copy link
Copy Markdown
Member

I was running into a bug where MockedCANCoderTest was failing semi-regularly. This PR introduces three additional waits to reduce this occurrence. I tried a couple configurations.

Adding a check after setting the position to 0 and performing two waits before each check seemed to be the best combination of functionality and clarity.

(Note: From my testing, it was not clear that increasing the timeout parameter or changing the location of the wait calls had a significant effect on the failure rate.)

Original Failure Rate: 18/100 (The denominator is not a typo. This number is from a test 10x smaller than the others.)
Failure rate after adding wait on line 34: 38/1000
Failure after adding waits on lines 34 and 44: 1/1000
Failure after adding waits on lines 34, 44, and 35: 2/1000

These last two results both have a <1% failure rate, so they are basically identical. I kept the extra wait in because it's clearer just to perform two waits before reading any data. I tried to run some more detailed tests on them, but they didn't return reasonable results.

@brettle brettle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for pointing out this issue! My preference would be the fix I just submitted as PR #83 because it more accurately conveys the test's intent. If you are ok with that, please confirm that PR works for you with NUM_REPS = 10000 (it does for me on Linux) and then approve/merge it (with NUM_REPS=1) and close this PR. If not, I'm happy to discuss.

@CoolSpy3

Copy link
Copy Markdown
Member Author

Agreed 👍

Closing as resolved by #83.

@CoolSpy3 CoolSpy3 closed this Apr 29, 2024
@brettle
brettle deleted the patch-MockedCANCoderTest branch May 14, 2024 21:56
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.

2 participants