mirror of
https://github.com/wassname/ray.git
synced 2026-07-08 09:51:03 +08:00
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:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user