long_running_tests.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from typing import Optional
  2. from ray_release.test import Test
  3. from ray_release.result import Result
  4. def handle_result(
  5. test: Test,
  6. result: Result,
  7. ) -> Optional[str]:
  8. last_update_diff = result.results.get("last_update_diff", float("inf"))
  9. test_name = test["name"]
  10. if test_name in [
  11. "long_running_actor_deaths",
  12. "long_running_many_actor_tasks",
  13. "long_running_many_drivers",
  14. "long_running_many_tasks",
  15. "long_running_many_tasks_serialized_ids",
  16. "long_running_node_failures",
  17. ]:
  18. # Core tests
  19. target_update_diff = 300
  20. elif test_name in [
  21. "long_running_apex",
  22. "long_running_impala",
  23. "long_running_many_ppo",
  24. "long_running_pbt",
  25. ]:
  26. # Tune/RLlib style tests
  27. target_update_diff = 480
  28. elif test_name in ["long_running_serve"]:
  29. # Serve tests have workload logs every five minutes.
  30. # Leave up to 180 seconds overhead.
  31. target_update_diff = 480
  32. elif test_name in ["long_running_serve_failure"]:
  33. # TODO (shrekris-anyscale): set update_diff limit for serve failure
  34. target_update_diff = float("inf")
  35. else:
  36. return None
  37. if last_update_diff > target_update_diff:
  38. return (
  39. f"Last update to results json was too long ago "
  40. f"({last_update_diff:.2f} > {target_update_diff})"
  41. )
  42. return None