Skip to content

Commit

Permalink
mark.ray for prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Oct 2, 2024
1 parent ed48dc2 commit 07a8755
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_prefetch_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def ray_init_and_shutdown():
ray.shutdown()


@pytest.mark.ray
def test_initialization_and_basic_functionality():
def simple_producer():
for i in range(10):
Expand All @@ -32,6 +33,7 @@ def simple_producer():
assert results == list(range(10))


@pytest.mark.ray
def test_queue_size_limit():
def simple_producer() -> Iterator[ray.ObjectRef]:
for i in range(100):
Expand All @@ -48,6 +50,7 @@ def simple_producer() -> Iterator[ray.ObjectRef]:
assert actor.queue_size() == 10


@pytest.mark.ray
def test_stop_functionality():
def simple_producer():
for i in range(10):
Expand All @@ -59,6 +62,7 @@ def simple_producer():
_sleep_until(lambda: actor.is_stopped(), message="Actor did not stop")


@pytest.mark.ray
def test_exception_handling():
def faulty_producer():
for i in range(5):
Expand All @@ -75,6 +79,7 @@ def faulty_producer():
assert results == list(range(5))


@pytest.mark.ray
def test_empty_producer():
def empty_producer() -> Iterator[ray.ObjectRef]:
if False:
Expand All @@ -85,6 +90,7 @@ def empty_producer() -> Iterator[ray.ObjectRef]:
actor.get_next()


@pytest.mark.ray
def test_multiple_consumers():
def simple_producer() -> Iterator[ray.ObjectRef]:
for i in range(20):
Expand All @@ -96,6 +102,7 @@ def simple_producer() -> Iterator[ray.ObjectRef]:
assert results == list(range(20))


@pytest.mark.ray
def test_producer_completion():
def simple_producer():
for i in range(10):
Expand Down

0 comments on commit 07a8755

Please sign in to comment.