diff --git a/python/ray/tests/test_actor.py b/python/ray/tests/test_actor.py index 700407805ded..edea8c918be5 100644 --- a/python/ray/tests/test_actor.py +++ b/python/ray/tests/test_actor.py @@ -735,7 +735,6 @@ def f(self, y): t.f(1) -@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.") def test_actor_deletion(ray_start_regular_shared): # Make sure that when an actor handles goes out of scope, the actor # destructor is called. @@ -1007,7 +1006,6 @@ def get_value(self): actor_create_time - start, end - start)) -@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.") @pytest.mark.parametrize( "exit_condition", [ @@ -1036,7 +1034,9 @@ def exit(self): ray.actor.exit_actor() data = "hello" - tmpfile = tempfile.NamedTemporaryFile() + tmpfile = tempfile.NamedTemporaryFile("w+", suffix=".tmp", delete=False) + tmpfile.close() + a = A.remote(tmpfile.name, data) ray.get(a.ready.remote()) @@ -1052,7 +1052,7 @@ def exit(self): assert False, "Unrecognized condition" def check_file_written(): - with open(tmpfile.name) as f: + with open(tmpfile.name, "r") as f: if f.read() == data: return True return False @@ -1063,6 +1063,8 @@ def check_file_written(): else: wait_for_condition(check_file_written) + os.unlink(tmpfile.name) + def test_return_actor_handle_from_actor(ray_start_regular_shared): @ray.remote