Fix occasional spurious test failures. #424
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One sentence summary of this PR (This should go in the CHANGELOG!)
Fix two tests that fail on occasion for [IMHO] no good reason.
Link to Related Issue(s)
N/A
Please describe the changes in your request.
Two tests would sometime fail for me:
ofrak_core/test_ofrak/components/test_comments.py::test_comment_content
had a default 200ms time limit, and once in a while, the limit would be violated (particularly, if other things happen to be running at the same time the tests run) - I have seem numbers as high as 1.6 s on occasion. I bumped the limit to 5s.ofrak_core/test_ofrak/unit/test_ofrak_context.py::test_get_ofrak_context_over_time
would occasionally fail with theRuntimeError: There is no current event loop in thread 'MainThread'
error message. I am guessing that would happen when another test executed earlier in the same worker would happen to mess with the asyncio event loop, so I made sure an event loop was available (similar to how the other tests in the same file do it). Not 100% sure this is the right thing, but seems to work.Anyone you think should look at this, specifically?
Not sure. @whyitfor maybe?