Skip to content

Commit

Permalink
wait for playbook run
Browse files Browse the repository at this point in the history
  • Loading branch information
lfkdev committed Jun 30, 2024
1 parent b6b5e59 commit aab7dab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test_ansible_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def test_job_creation_and_retrieval(self):
response = self.client.get(f'{API_PATH}/ansible/job/{job_id}')
self.assertEqual(response.status_code, 200, f"Failed to retrieve job {job_id}, status code: {response.status_code}")
job_data = json.loads(response.data)
if job_data['status'] != 'running':
if job_data['status'] not in ['running', 'pending']:
break
time.sleep(wait_interval)
elapsed_time += wait_interval

time.sleep(8)
self.assertNotEqual(job_data['status'], 'running', f"Job {job_id} is still running after {max_wait_time} seconds")

# check keys using endpoint
Expand Down

0 comments on commit aab7dab

Please sign in to comment.