Skip to content

Commit

Permalink
[Windows] Enable test_advanced_2 on windows (ray-project#20994)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip authored Dec 15, 2021
1 parent e485aa8 commit d2cd073
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
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

0 comments on commit d2cd073

Please sign in to comment.