mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Fix test flake due to host metric id enumeration (#15875)
This commit is contained in:
parent
abc04e5c88
commit
ee739b5fd9
@ -135,8 +135,9 @@ class TestEvents:
|
||||
|
||||
self._create_job_event(ok=dict((hostname, len(hostname)) for hostname in self.hostnames))
|
||||
|
||||
# Soft delete 6 host metrics
|
||||
for hm in HostMetric.objects.filter(id__in=[1, 3, 5, 7, 9, 11]):
|
||||
# Soft delete 6 of the 12 host metrics, every even host like "Host 2" or "Host 4"
|
||||
for host_name in self.hostnames[::2]:
|
||||
hm = HostMetric.objects.get(hostname=host_name.lower())
|
||||
hm.soft_delete()
|
||||
|
||||
assert len(HostMetric.objects.filter(Q(deleted=False) & Q(deleted_counter=0) & Q(last_deleted__isnull=True))) == 6
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user