Fix checkpoint crash for actor creation task. (#4327)

* Fix checkpoint crash for actor creation task.

* Lint

* Move test to test_actor.py

* Revert unused code in test_failure.py

* Refine test according to Raul's suggestion.
This commit is contained in:
Yuhong Guo
2019-03-14 23:42:57 +08:00
committed by GitHub
parent 2f37cd7e27
commit becffc6cef
4 changed files with 57 additions and 15 deletions
+13
View File
@@ -81,3 +81,16 @@ def run_string_as_driver_nonblocking(driver_script):
f.flush()
return subprocess.Popen(
[sys.executable, f.name], stdout=subprocess.PIPE)
def relevant_errors(error_type):
return [info for info in ray.error_info() if info["type"] == error_type]
def wait_for_errors(error_type, num_errors, timeout=10):
start_time = time.time()
while time.time() - start_time < timeout:
if len(relevant_errors(error_type)) >= num_errors:
return
time.sleep(0.1)
raise Exception("Timing out of wait.")