mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 11:57:37 -02:30
Fix indirect host counting task test race condition (#15871)
This commit is contained in:
@@ -50,7 +50,8 @@ def test_indirect_host_counting(live_tmp_folder, run_job_from_playbook):
|
|||||||
job.refresh_from_db()
|
job.refresh_from_db()
|
||||||
if job.event_queries_processed is False:
|
if job.event_queries_processed is False:
|
||||||
save_indirect_host_entries.delay(job.id, wait_for_events=False)
|
save_indirect_host_entries.delay(job.id, wait_for_events=False)
|
||||||
# This will poll for the background task to finish
|
|
||||||
|
# event_queries_processed only assures the task has started, it might take a minor amount of time to finish
|
||||||
for _ in range(10):
|
for _ in range(10):
|
||||||
if IndirectManagedNodeAudit.objects.filter(job=job).exists():
|
if IndirectManagedNodeAudit.objects.filter(job=job).exists():
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user