Skip to content

Fix occasional spurious test failures.#424

Merged
whyitfor merged 2 commits into
redballoonsecurity:masterfrom
ANogin:maintenance/test_robustness
Feb 18, 2024
Merged

Fix occasional spurious test failures.#424
whyitfor merged 2 commits into
redballoonsecurity:masterfrom
ANogin:maintenance/test_robustness

Conversation

@ANogin
Copy link
Copy Markdown
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?

Comment thread ofrak_core/test_ofrak/components/test_comments.py
@ANogin ANogin requested a review from whyitfor February 18, 2024 03:23
Copy link
Copy Markdown
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
ANogin pushed 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.

2 participants