Skip to content

Commit f71d4ae

Browse files
authored
Make test_session_set_progress more stable under Ray tests (#3103)
1 parent 1aa6936 commit f71d4ae

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

mars/deploy/oscar/tests/test_local.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,14 +608,15 @@ async def test_session_get_progress(create_cluster):
608608
assert session.session_id is not None
609609

610610
raw = np.random.rand(100, 4)
611-
t = mt.tensor(raw, chunk_size=5)
611+
t = mt.tensor(raw, chunk_size=50)
612612

613613
def f1(c):
614614
time.sleep(0.5)
615615
return c
616616

617617
t1 = t.sum()
618-
r = t1.map_chunk(f1)
618+
t2 = t1.map_chunk(f1)
619+
r = t2.map_chunk(f1)
619620
info = await session.execute(r)
620621

621622
for _ in range(100):

mars/deploy/oscar/tests/test_ray_dag.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@
6060
@pytest.mark.parametrize(indirect=True)
6161
@pytest.fixture
6262
async def create_cluster(request):
63+
param = getattr(request, "param", {})
6364
start_method = os.environ.get("POOL_START_METHOD", None)
6465
client = await new_cluster(
6566
subprocess_start_method=start_method,
6667
backend="ray",
6768
n_worker=2,
6869
n_cpu=2,
6970
use_uvloop=False,
71+
config=param.get("config", None),
7072
)
7173
async with client:
7274
assert client.session.client is not None
@@ -123,7 +125,11 @@ def test_sync_execute(ray_start_regular_shared2, config):
123125

124126

125127
@require_ray
126-
@pytest.mark.skip("Enable when ray progress got fixed")
128+
@pytest.mark.parametrize(
129+
"create_cluster",
130+
[{"config": {"task.execution_config.ray.subtask_monitor_interval": 0}}],
131+
indirect=True,
132+
)
127133
@pytest.mark.asyncio
128134
async def test_session_get_progress(ray_start_regular_shared2, create_cluster):
129135
await test_local.test_session_get_progress(create_cluster)

0 commit comments

Comments
 (0)