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

Add retries in dynamic resource test cases #5550

Closed

Conversation

romilbhardwaj
Copy link
Member

@romilbhardwaj romilbhardwaj commented Aug 27, 2019

Why are these changes needed?

Some of the dynamic resource test cases fail intermittently with KeyError when querying ray.available_resources() or ray.available_resources(). I believe this happens in rare cases when there are delays in GCS updates/heartbeat propagation and the test ends up querying the resource state before it has been updated.

As a fix, this PR adds a retry-timeout mechanism which retries the assertion condition until a short timeout elapses.

Linter

  • I've run scripts/format.sh to lint the changes in this PR.

if condition():
return True
time.sleep(SLEEP_DURATION)
time_elapsed += SLEEP_DURATION
Copy link
Member Author

Choose a reason for hiding this comment

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

I extracted this method from test_release_cpus_when_actor_creation_task_blocking, but I'm not sure if this is the best way to check for a timeout. Should we be using time_elapsed = time.time() - start_time? Otherwise this is equivalent to having a fixed number of retries.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16570/
Test PASSed.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@ericl ericl closed this Dec 29, 2019
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.

None yet

3 participants