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

enable test_advanced_2 on windows #20994

Merged
merged 8 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ python/.eggs
*.so
*.dylib
*.dll
python/ray/_raylet.pyd

# Incremental linking files
*.ilk
Expand Down
1 change: 0 additions & 1 deletion ci/travis/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ test_python() {
-python/ray/serve:test_standalone # timeout
-python/ray/tests:test_actor_advanced # timeout
-python/ray/tests:test_actor_failures # flaky
-python/ray/tests:test_advanced_2
-python/ray/tests:test_autoscaler # We don't support Autoscaler on Windows
-python/ray/tests:test_autoscaler_aws
-python/ray/tests:test_component_failures
Expand Down
9 changes: 9 additions & 0 deletions python/ray/_private/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,15 @@ def preexec_fn():
# before the process itself is assigned to the job.
# After that point, its children will not be added to the job anymore.
CREATE_SUSPENDED = 0x00000004 # from Windows headers
if sys.platform == "win32":
# CreateProcess, which underlies Popen, is limited to
# 32,767 characters, including the Unicode terminating null
# character
total_chrs = sum([len(x) for x in command])
if total_chrs > 31766:
raise ValueError(
f"command is limited to a total of 31767 characters, "
f"got {total_chrs}")

process = ConsolePopen(
command,
Expand Down
5 changes: 0 additions & 5 deletions python/ray/tests/test_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ def test_illegal_api_calls(ray_start_regular):

@pytest.mark.skipif(
client_test_enabled(), reason="grpc interaction with releasing resources")
@pytest.mark.skipif(sys.platform == "win32", reason="Time out on Windows")
def test_multithreading(ray_start_2_cpus):
# This test requires at least 2 CPUs to finish since the worker does not
# release resources when joining the threads.
Expand Down Expand Up @@ -653,7 +652,6 @@ def bar():

# This case tests whether gcs-based actor scheduler works properly with
# a normal task co-existed.
@pytest.mark.skipif(sys.platform == "win32", reason="Time out on Windows")
def test_schedule_actor_and_normal_task(ray_start_cluster):
cluster = ray_start_cluster
cluster.add_node(
Expand Down Expand Up @@ -699,7 +697,6 @@ def fun(singal1, signal_actor2):

# This case tests whether gcs-based actor scheduler works properly
# in a large scale.
@pytest.mark.skipif(sys.platform == "win32", reason="Time out on Windows")
def test_schedule_many_actors_and_normal_tasks(ray_start_cluster):
cluster = ray_start_cluster

Expand Down Expand Up @@ -742,7 +739,6 @@ def fun():
# This case tests whether gcs-based actor scheduler distributes actors
# in a balanced way. By default, it uses the `SPREAD` strategy of
# gcs resource scheduler.
@pytest.mark.skipif(sys.platform == "win32", reason="Time out on Windows")
@pytest.mark.parametrize("args", [[5, 20], [5, 3]])
def test_actor_distribution_balance(ray_start_cluster, args):
cluster = ray_start_cluster
Expand Down Expand Up @@ -783,7 +779,6 @@ def method(self):

# This case tests whether RequestWorkerLeaseReply carries normal task resources
# when the request is rejected (due to resource preemption by normal tasks).
@pytest.mark.skipif(sys.platform == "win32", reason="Time out on Windows")
def test_worker_lease_reply_with_resources(ray_start_cluster):
cluster = ray_start_cluster
cluster.add_node(
Expand Down
9 changes: 8 additions & 1 deletion python/ray/tests/test_advanced_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
logger = logging.getLogger(__name__)


@pytest.mark.skipif(sys.platform == "win32", reason="OOM on Windows")
def test_resource_constraints(shutdown_only):
num_workers = 20
ray.init(num_cpus=10, num_gpus=2)
Expand Down Expand Up @@ -94,6 +95,7 @@ def f(n):
assert duration > 1


@pytest.mark.skipif(sys.platform == "win32", reason="OOM on Windows")
def test_multi_resource_constraints(shutdown_only):
num_workers = 20
ray.init(num_cpus=10, num_gpus=10)
Expand Down Expand Up @@ -559,7 +561,12 @@ def k():


def test_many_custom_resources(shutdown_only):
num_custom_resources = 10000
# This eventually turns into a command line argument which on windows is
# limited to 32,767 characters.
if sys.platform == "win32":
num_custom_resources = 4000
else:
num_custom_resources = 10000
total_resources = {
str(i): np.random.randint(1, 7)
for i in range(num_custom_resources)
Expand Down