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

tests: Fix intemittent multithreaded unit test failure #210

Merged
merged 7 commits into from
Sep 20, 2019

Conversation

oakbani
Copy link
Contributor

@oakbani oakbani commented Sep 17, 2019

Summary

A Polling Manager unit test intermittently fails on some Python versions.
See here: https://travis-ci.org/optimizely/python-sdk/jobs/585691111

Trying multiple approaches of using a short polling interval, using a blocking queue with a mocked side_effect, and putting a time sleep before assertion reveals that this is some issue with mocked object on pypy and pypy3 that it does not know even if it has been called many times.

We can get rid of this assertion since we are already asserting is_running flag to ensure that the thread is running

Test plan

Should pass existing unit tests.

Issues

@coveralls
Copy link

coveralls commented Sep 17, 2019

Coverage Status

Coverage increased (+0.2%) to 96.604% when pulling b48f7fb on oakbani/fix-unit-test-on-pypy into 547a13c on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.422% when pulling a0b7460 on oakbani/fix-unit-test-on-pypy into 547a13c on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.422% when pulling a0b7460 on oakbani/fix-unit-test-on-pypy into 547a13c on master.

@oakbani
Copy link
Contributor Author

oakbani commented Sep 18, 2019

Looks like the issue with pypy/pypy3 is something else. The background thread is running as I can see the log but the mocked object 'fetch_datafile' is not being told that it has been called.
image

@oakbani oakbani closed this Sep 18, 2019
@oakbani oakbani reopened this Sep 18, 2019
@oakbani oakbani closed this Sep 18, 2019
@oakbani oakbani reopened this Sep 18, 2019
@msohailhussain msohailhussain requested review from aliabbasrizvi and removed request for aliabbasrizvi September 18, 2019 17:53
@msohailhussain msohailhussain marked this pull request as ready for review September 19, 2019 22:59
@msohailhussain msohailhussain requested a review from a team as a code owner September 19, 2019 22:59
@aliabbasrizvi aliabbasrizvi merged commit 239b687 into master Sep 20, 2019
@aliabbasrizvi aliabbasrizvi deleted the oakbani/fix-unit-test-on-pypy branch September 20, 2019 05:39
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.

4 participants