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

Make start timeout work properly. #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

artikz
Copy link

@artikz artikz commented May 21, 2017

self.alive is an RPC call, which can take a long time (e.g. 45s) if there are problems with communicating to server.
Previously the loop was being executed exactly timeout * 10 times before timing out, resulting in 450s timeout instead of the requested value.
Now it is executed only until current timestamp is larger or equal the pre-calculated expiration time.

self.alive is an RPC call, which can take a long time (e.g. 45s) if there are problems with communicating to server.
Previously the loop was being executed exactly timeout * 10 times befor timing out, resulting in 450s timeout instead of the requested value.
Now it is executed only until current timestamp is larger or equal the pre-calculated expiration time.
Copy link

@mcdaniel67 mcdaniel67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing travis run rebased on top of my travis fix pr:
https://travis-ci.org/mcdaniel67/uiautomator/builds/234657095

time.sleep(0.1)
timeout -= 0.1
if not self.alive:
step_secs = 0.1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts about making this a defaulted argument?

A doc string would be good on this method too.


# Tests that start() timeout works correctly even in case communication
# with device takes too long.
def test_start_timeout_works_properly(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test could be named better, particularly the "_works_properly" part. Maybe call it test_start_timeout_slow_device?

Also, any reason to go with comments over a docstring?

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