Skip to content

Commit

Permalink
Merge branch 'fix-test-basic-hang' of github.com:ericl/ray into fix-t…
Browse files Browse the repository at this point in the history
…est-basic-hang
  • Loading branch information
ericl committed Jan 29, 2022
2 parents ce0f8c5 + a564aac commit 938c121
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/ray/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ def __next__(self) -> "Dataset[T]":
raise StopIteration
self._ds._set_epoch(self._i)
self._i += 1
return lambda: self._ds
return lambda: self._ds.force_reads()

class Iterable:
def __init__(self, ds: "Dataset[T]"):
Expand Down
7 changes: 7 additions & 0 deletions python/ray/data/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,18 @@ def _read_stream(self, f: "pa.NativeFile", path: str, **reader_args):
@pytest.mark.parametrize("pipelined", [False, True])
def test_basic_actors(shutdown_only, pipelined):
ray.init(num_cpus=2)
<<<<<<< HEAD
n = 5
ds = ray.data.range(n)
ds = maybe_pipeline(ds, pipelined)
assert sorted(ds.map(lambda x: x + 1, compute="actors").take()) == list(
range(1, n + 1))
=======
ds = ray.data.range(20)
ds = maybe_pipeline(ds, pipelined)
assert sorted(ds.map(lambda x: x + 1, compute="actors").take()) == range(
1, 20)
>>>>>>> a564aac47df38032ee6372083355745c11e03912


@pytest.mark.parametrize("pipelined", [False, True])
Expand Down
2 changes: 1 addition & 1 deletion python/ray/data/tests/test_pipeline_nohang.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ray.tests.conftest import * # noqa

NUM_REPEATS = 10
NUM_TASKS = 20
NUM_TASKS = 10


# This test can be flaky if there is resource deadlock between the pipeline
Expand Down

0 comments on commit 938c121

Please sign in to comment.