long_running_tests.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. ]:
  25. # Tune/RLlib style tests
  26. target_update_diff = 480
  27. elif test_name in ["long_running_serve"]:
  28. # Serve tests have workload logs every five minutes.
  29. # Leave up to 180 seconds overhead.
  30. target_update_diff = 480
  31. elif test_name in ["long_running_serve_failure"]:
  32. # TODO (shrekris-anyscale): set update_diff limit for serve failure
  33. target_update_diff = float("inf")
  34. else:
  35. return None
  36. if last_update_diff > target_update_diff:
  37. return (
  38. f"Last update to results json was too long ago "
  39. f"({last_update_diff:.2f} > {target_update_diff})"
  40. )
  41. return None