Skip to content

Commit

Permalink
Except RayTaskError additionally in test_future_cancellation when can…
Browse files Browse the repository at this point in the history
…celling future
  • Loading branch information
AnesBenmerzoug committed Oct 26, 2023
1 parent 7dac359 commit 5d409d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/utils/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def test_future_cancellation(parallel_config):

assert future.result() == 2

from ray.exceptions import TaskCancelledError
from ray.exceptions import RayTaskError, TaskCancelledError

with init_executor(
config=parallel_config, cancel_futures=CancellationPolicy.ALL
Expand All @@ -256,7 +256,7 @@ def test_future_cancellation(parallel_config):

assert future._state == "FINISHED"

with pytest.raises(TaskCancelledError):
with pytest.raises((TaskCancelledError, RayTaskError)):
future.result()

assert time.monotonic() - start < 1

0 comments on commit 5d409d1

Please sign in to comment.