Refactor pytest fixtures for ray core (#4390)

This commit is contained in:
Yuhong Guo
2019-03-20 11:48:32 +08:00
committed by Hao Chen
parent c6f15a0057
commit 8ce7565530
22 changed files with 378 additions and 681 deletions
+4 -12
View File
@@ -473,21 +473,13 @@ def test_nondeterministic_task(ray_start_reconstruction):
assert cluster.remaining_processes_alive()
@pytest.fixture
def ray_start_driver_put_errors():
plasma_store_memory = 10**9
# Start the Ray processes.
ray.init(num_cpus=1, object_store_memory=plasma_store_memory)
yield plasma_store_memory
# The code after the yield will run as teardown code.
ray.shutdown()
@pytest.mark.skipif(
os.environ.get("RAY_USE_NEW_GCS") == "on",
reason="Failing with new GCS API on Linux.")
def test_driver_put_errors(ray_start_driver_put_errors):
plasma_store_memory = ray_start_driver_put_errors
@pytest.mark.parametrize(
"ray_start_object_store_memory", [10**9], indirect=True)
def test_driver_put_errors(ray_start_object_store_memory):
plasma_store_memory = ray_start_object_store_memory
# Define the size of one task's return argument so that the combined
# sum of all objects' sizes is at least twice the plasma stores'
# combined allotted memory.