Skip to content

Commit

Permalink
fix: make indirect host counting live test more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
pb82 committed Mar 4, 2025
1 parent 7b8b37d commit 293abc8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion awx/main/tests/live/tests/test_indirect_host_counting.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ def test_indirect_host_counting(live_tmp_folder, run_job_from_playbook):
# Task might not run due to race condition, so make it run here
job.refresh_from_db()
if job.event_queries_processed is False:
save_indirect_host_entries.delay(job.id, wait_for_events=False)
for _ in range(10):
save_indirect_host_entries.delay(job.id, wait_for_events=True)
job.refresh_from_db()
if job.event_queries_processed is True:
break
time.sleep(0.5)
else:
raise RuntimeError(f'Job events not received for job_id={job.id}')

# This will poll for the background task to finish
for _ in range(10):
if IndirectManagedNodeAudit.objects.filter(job=job).exists():
Expand Down

0 comments on commit 293abc8

Please sign in to comment.