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

Better checking that ray.init() has been called. #10261

Merged
merged 5 commits into from
Aug 26, 2020

Conversation

robertnishihara
Copy link
Collaborator

Why are these changes needed?

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/latest/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failure rates at https://ray-travis-tracker.herokuapp.com/.
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested (please justify below)

Copy link
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes!

@sven1977
Copy link
Contributor

Just some linting errors.

@robertnishihara
Copy link
Collaborator Author

Rebasing to fix linting errors (which were not introduced by this PR I believe).

@robertnishihara
Copy link
Collaborator Author

Actually @sven1977 it's not just linting errors, the test added in this PR is failing on some of the builds.

"__version__",
"_config",
"_get_runtime_context",
"actor",
"actors",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just making these more alphabetical.

import ray


def test_errors_before_initializing_ray():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I initially put this in test_basic.py, however, that has module level initialization with pytest, so ray was already initialized, and this test requires ray to be uninitialized.

@@ -427,6 +429,9 @@ def get_resource_ids():
each pair consists of the ID of a resource and the fraction of that
resource reserved for this worker.
"""
worker = global_worker
Copy link
Contributor

Choose a reason for hiding this comment

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

global_worker.check_connected() ? worker is not used later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used

worker = global_worker
worker.check_connected()

because that's how it's done in the rest of this file. We should probably undo this at some point.

@robertnishihara robertnishihara merged commit 79eefbf into ray-project:master Aug 26, 2020
@robertnishihara robertnishihara deleted the checkinitialized branch August 26, 2020 00:13
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