hunk.code_window:                         "--download-dir",
                           tmpdir,
                       ]
                   )
               except Exception as e:
                   logger.log(f"Failed to download logs from anyscale {e}")
                   return None
               return AnyscaleJobManager._find_job_driver_and_ray_error_logs(tmpdir)
       @staticmethod
  
hunk.labels: keep keep keep keep keep replace replace keep keep keep
hunk.after_edit:                 logger.exception(f"Failed to download logs from anyscale {e}")
                   return None, None
  
hunk.file_path: release/ray_release/job_manager/anyscale_job_manager.py
hunk.type: replace
file: import pytest
  import sys
  import tempfile
  import os
  
  from ray_release.util import ERROR_LOG_PATTERNS
  from ray_release.job_manager.anyscale_job_manager import AnyscaleJobManager
  
  
  def test_get_ray_error_logs():
      with tempfile.TemporaryDirectory() as tmpdir:
          with open(os.path.join(tmpdir, "log01"), "w") as f:
              f.writelines(ERROR_LOG_PATTERNS[:1])
          with open(os.path.join(tmpdir, "log02"), "w") as f:
              f.writelines(ERROR_LOG_PATTERNS + ["haha"])
          with open(os.path.join(tmpdir, "job-driver-w00t"), "w") as f:
              f.writelines("w00t")
          (
              job_driver_log,
              ray_error_log,
          ) = AnyscaleJobManager._find_job_driver_and_ray_error_logs(tmpdir)
          assert ray_error_log == "".join(ERROR_LOG_PATTERNS + ["haha"])
          assert job_driver_log == "w00t"
  
  
  if __name__ == "__main__":
      sys.exit(pytest.main(["-v", __file__]))
  