Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit21f9bc4

Browse files
kevin85421Dhakshin Suriakannu
authored and
Dhakshin Suriakannu
committed
[core]test_job_isolation passes even when exceptions are thrown (ray-project#51694)
`call_ray_start` uses an unusual method to obtain the GCS address. Itexecutes a `ray start` command and then parses the command's STDOUT.However, this method will return "None" as address. See the followingscreenshot for more details.https://github.com/ray-project/ray/blob/a5bab234e651d19b91d5860be0606d4c6c01d118/python/ray/tests/conftest.py#L771-L789---------Signed-off-by: Kai-Hsun Chen <kaihsun@anyscale.com>Signed-off-by: Dhakshin Suriakannu <d_suriakannu@apple.com>
1 parent7fb719f commit21f9bc4

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

‎python/ray/tests/test_job.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ def test_invalid_gcs_address():
5656
JobSubmissionClient("abc:abc")
5757

5858

59-
@pytest.mark.skipif(
60-
sys.version_info>= (3,12),reason="lib is not supported on Python 3.12"
61-
)
62-
deftest_job_isolation(call_ray_start):
59+
deftest_job_isolation(ray_start_regular):
6360
# Make sure two jobs with same module name
6461
# don't interfere with each other
6562
# (https://github.com/ray-project/ray/issues/19358).
66-
address=call_ray_start
63+
gcs_address=ray_start_regular.address_info["gcs_address"]
64+
6765
lib_template="""
6866
import ray
6967
@@ -88,19 +86,34 @@ def subtask():
8886
withopen(v1_lib,"w")asf:
8987
f.write(lib_template.format(1))
9088
withopen(v1_driver,"w")asf:
91-
f.write(driver_template.format(address,1))
89+
f.write(driver_template.format(gcs_address,1))
9290

9391
os.makedirs(os.path.join(tmpdir,"v2"))
9492
v2_lib=os.path.join(tmpdir,"v2","lib.py")
9593
v2_driver=os.path.join(tmpdir,"v2","driver.py")
9694
withopen(v2_lib,"w")asf:
9795
f.write(lib_template.format(2))
9896
withopen(v2_driver,"w")asf:
99-
f.write(driver_template.format(address,2))
97+
f.write(driver_template.format(gcs_address,2))
10098

10199
subprocess.check_call([sys.executable,v1_driver])
102100
subprocess.check_call([sys.executable,v2_driver])
103101

102+
dashboard_url=ray_start_regular.dashboard_url
103+
client=JobSubmissionClient(f"http://{dashboard_url}")
104+
jobs=client.list_jobs()
105+
assertlen(jobs)==3# ray_start_regular, v1, v2
106+
107+
num_succeeded=0
108+
num_running=0
109+
forjobinjobs:
110+
ifjob.status=="SUCCEEDED":
111+
num_succeeded+=1
112+
elifjob.status=="RUNNING":
113+
num_running+=1
114+
assertnum_succeeded==2
115+
assertnum_running==1
116+
104117

105118
deftest_job_observability(ray_start_regular):
106119
driver_template="""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp