Skip to content

Conversation

@RobertLucian
Copy link
Member

@RobertLucian RobertLucian commented May 11, 2021

This is to fix the following error (from this build https://app.circleci.com/pipelines/github/cortexlabs/cortex/9975/workflows/baf607ea-73ae-4066-be0f-da89a5586909/jobs/12944) that can occur for a batch API:

            # assert jobs
            printer("checking the jobs' responses")
            for job_spec in job_specs:
                job_id: str = job_spec["job_id"]
                job_status = requests.get(f"{api_endpoint}?jobID={job_id}").json()["job_status"]
    
                assert (
>                   job_status["batches_in_queue"] == 0
                ), f"there are still batches in queue ({job_status['batches_in_queue']}) for job ID {job_id}"
E               KeyError: 'batches_in_queue'

So if there are no batches in the queue, then batches_in_queue field won't be present in the batch response. And that's what the KeyError: 'batches_in_queue' error is about.


checklist:

  • run make test and make lint
  • test manually (i.e. build/push all images, restart operator, and re-deploy APIs)

@RobertLucian RobertLucian added the bug Something isn't working label May 11, 2021
@RobertLucian RobertLucian merged commit 3d17e8b into master May 11, 2021
@RobertLucian RobertLucian deleted the fix/batch-test branch May 11, 2021 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants