Waits until the jobs appears in the completed job queue.

def wait_for_jobs(self, job_ids, timeout, delay):
        """Waits until the jobs appears in the completed job queue."""
        if self.skip:
            return

        logger.debug("Waiting up to %d sec for completion of the job IDs %s", timeout, job_ids)

        remaining_job_ids = set(job_ids)
        found_jobs = []

        countdown = timeout
        while countdown > 0:
            matched_jobs = self.find_jobs(remaining_job_ids)
            if matched_jobs:
                remaining_job_ids.difference_update({job["id"] for job in matched_jobs})
                found_jobs.extend(matched_jobs)
            if not remaining_job_ids:
                return found_jobs
            time.sleep(delay)
            countdown -= delay

        logger.error(
            "Timed out while waiting for completion of the job IDs %s. Results not updated.",
            list(remaining_job_ids),
        )