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

Fix no cpus test #5009

Merged
merged 3 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions python/ray/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ def _ray_start(**kwargs):
ray.shutdown()


# The following fixture will start ray with 1 cpu.
raulchen marked this conversation as resolved.
Show resolved Hide resolved
@pytest.fixture
def ray_start_no_cpu(request):
param = getattr(request, "param", {})
with _ray_start(num_cpus=0, **param) as res:
yield res


# The following fixture will start ray with 1 cpu.
@pytest.fixture
def ray_start_regular(request):
Expand Down
2 changes: 1 addition & 1 deletion python/ray/tests/test_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ def f():
assert actor_id not in resulting_ids


def test_actors_on_nodes_with_no_cpus(ray_start_regular):
def test_actors_on_nodes_with_no_cpus(ray_start_no_cpu):
@ray.remote
class Foo(object):
def method(self):
Expand Down