def METHOD_NAME(name, job_type, timeout):
  end_time = datetime.datetime.now() + timeout
  logging.info("expect done time: {0}".format(end_time))
  status = get_job_status(name, job_type)
  while _is_active_status(status):
    if datetime.datetime.now() > end_time:
      timeoutMsg = "Timeout waiting for job {0} with job type {1} completing.".format(name ,job_type)
      logging.error(timeoutMsg)
      raise Exception(timeoutMsg)
    time.sleep(3)
    status = get_job_status(name, job_type)
  logging.info("job {0} with type {1} status is {2}".format(name, job_type, status))