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 occasional spurious test failures. #424

Merged

Conversation

ANogin
Copy link
Contributor

@ANogin ANogin commented Feb 18, 2024

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 the RuntimeError: 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?

@ANogin ANogin requested a review from whyitfor February 18, 2024 03:23
Copy link
Contributor

@whyitfor whyitfor left a comment

Choose a reason for hiding this comment

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

LGTM

@whyitfor whyitfor merged commit f05d3ca into redballoonsecurity:master Feb 18, 2024
5 checks passed
ANogin added a commit to ANogin/ofrak that referenced this pull request May 30, 2024
* Increase time limit on `test_comment_content`

* Fix a spurious "no current event loop" test error
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.

None yet

2 participants