-
Notifications
You must be signed in to change notification settings - Fork 37
fix: tests that utilize threading from failing with pypy #383
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
Conversation
Mat001
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks ok to me.
I'll re-run pypy tests on gitactions multiple times to see if they are stable.
jaeopt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - comments about the test changes will be helpful
|
@andrewleap-optimizely Can you please add expectations of |
msohailhussain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. please address comments before merge.
Summary
Due to a difference in the way pypy implements threading, tests utilizing threading have been intermittently failing the pypy CI. For the polling config manager, depending on when the polling thread started, it would sometimes poison the results, due to the mock library not interacting with the thread correctly.
For the forced decision test, mock's call_count is not thread safe, so the calls were sometimes not counted correctly.
Additionally, some of the polling config manager tests were calling fetch_datafile manually and then confirming that the polling thread was still alive. Since fetch_datafile wasn't being run by the thread, this check was not actually checking what it was purported to check.
Issues
FAILED tests/test_config_manager.py::PollingConfigManagerTest::test_fetch_datafile__status_exception_raised
AssertionError: 'New Time' !=
FAILED tests/test_user_context.py::UserContextTest::test_forced_decision_sync_return_correct_number_of_calls
AssertionError: 200 != 137