Skip to content

tests: Fix intemittent multithreaded unit test failure - #210

Merged
Ali Abbas Rizvi (aliabbasrizvi) merged 7 commits into
masterfrom
oakbani/fix-unit-test-on-pypy
Sep 20, 2019
Merged

Ali Abbas Rizvi (aliabbasrizvi) merged 7 commits into
masterfrom
oakbani/fix-unit-test-on-pypy

Conversation

@oakbani

@oakbani Owais Akbani (oakbani) commented Sep 17, 2019 •

Copy link
Copy Markdown
Contributor

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

Coveralls (coveralls) commented Sep 17, 2019 •

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor Author

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

@aliabbasrizvi
Ali Abbas Rizvi (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