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

Make TestPinger more robust. #6844

Merged
merged 4 commits into from Dec 6, 2018

Conversation

Projects
None yet
6 participants
@jsirois
Copy link
Member

jsirois commented Nov 30, 2018

Instead of trying to prop up servers to ping, just mock out the
requests library.

Fixes #6830

Make TestPinger more robust.
Instead of trying to prop up servers to ping, just mock out the
requests library.

Fixes #6830
@Eric-Arellano
Copy link
Contributor

Eric-Arellano left a comment

This is a great improvement! Much better than simply upping the timeout again.

@cosmicexplorer
Copy link
Contributor

cosmicexplorer left a comment

The failure on https://travis-ci.org/pantsbuild/pants/jobs/461886789 is weird, and I'm not sure what system is flaking out there or I would make an issue. This looks fantastic.

@jsirois

This comment has been minimized.

Copy link
Member

jsirois commented Nov 30, 2018

...and I'm not sure what system is flaking out there or I would make an issue

There is no need to understand a flake to file a bug.

Filed #6847

@jsirois

This comment has been minimized.

Copy link
Member

jsirois commented Nov 30, 2018

Huh - this appears to fail perfectly under CI's python 2.7 and works perfectly under my local python 2.7. Digging...

@TansyArron
Copy link
Contributor

TansyArron left a comment

I think that any solution relying on time.sleep will suffer the same issues as the original implementation when the CI machines are under heavy load, but its certainly worth a try!


def callback(_):
if latency < timeout:
time.sleep(latency)

This comment has been minimized.

@TansyArron

TansyArron Dec 3, 2018

Contributor

I believe this will result in the same errors as the original. The flake in these tests was always due to time.sleep behaving unpredictably on CI machines under heavy load.

This comment has been minimized.

@jsirois

jsirois Dec 5, 2018

Member

Thanks - that makes sense. This is only needed for 1 of the test methods - let me see what I can do to eliminate this outright.

This comment has been minimized.

@jsirois

jsirois Dec 5, 2018

Member

Fixed - PTAL

@jsirois

This comment has been minimized.

Copy link
Member

jsirois commented Dec 5, 2018

OK - the error is beacuse of an api difference in responses for declarative mocking vs mocking with callbacks: getsentry/responses#235 ... I am not sure how this passes on python3! That said - I can fix by using the current undocumented API.

@baroquebobcat
Copy link
Contributor

baroquebobcat left a comment

Looks good to me! Added suggestions for a typo

Show resolved Hide resolved tests/python/pants_test/cache/test_pinger.py Outdated
Show resolved Hide resolved tests/python/pants_test/cache/test_pinger.py Outdated
Show resolved Hide resolved tests/python/pants_test/cache/test_pinger.py Outdated
@Eric-Arellano
Copy link
Contributor

Eric-Arellano left a comment

These changes look great! Thanks Tansy for catching the underlying issue and John for reworking this.

Show resolved Hide resolved tests/python/pants_test/cache/test_pinger.py Outdated

@jsirois jsirois merged commit 16d1c7e into pantsbuild:master Dec 6, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jsirois jsirois deleted the jsirois:rust/ui/propagate_flush_errors branch Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment