Skip to content

Commit

Permalink
Wait for the job to be ready in test
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jan 31, 2024
1 parent 4981e45 commit cc70636
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/galaxy_test/api/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,15 @@ def test_delete_user_cancel_all_jobs(self):
)
self._assert_status_code_is_ok(run_response)

# Get the job state
job_id = run_response.json()["outputs"][0]["id"]

# Wait a bit for the job to be ready
expected_job_states = ["new", "queued", "running"]
dataset_populator.wait_for_job(job_id, ok_states=expected_job_states)

# Get the job state
job_response = self._get(f"jobs/{job_id}").json()
assert job_response["state"] in ["new", "queued", "running"], job_response
assert job_response["state"] in expected_job_states, job_response

# Delete user will cancel all jobs
self._delete(f"users/{user_id}", admin=True)
Expand Down

0 comments on commit cc70636

Please sign in to comment.