Check pre run failure cases with only 2 retry attempts

test_pre_run_failure_retry has been hitting timeouts semi regularly.
This test was checking that after all retry attempts other things
continue on. Rather than increasing the timeout time to avoid timeouts
we reduce the number of retry attempts from 3 to 2 which should make
things run faster and within the timeout. This should be safe from a
testing perspective because we're still doing at least one retry which
ensures that previous code paths are still exercised.

Change-Id: If78c7cdfac63c30f9e52a1a5984a662ab969c2ee
This commit is contained in:
Clark Boylan 2024-05-06 11:46:23 -07:00
parent 3589762367
commit 1b869c8237
2 changed files with 6 additions and 2 deletions

View File

@ -48,6 +48,11 @@
- job:
name: pre-failure
# Set attempts to a value less than the default of three but greater
# than 1 which results in no retries. This ensures testing covers code
# paths for retries without extra unnecesasry retries which make the
# tests run longer.
attempts: 2
files:
- pre-failure.txt
pre-run:

View File

@ -6281,7 +6281,7 @@ class TestEarlyFailure(AnsibleZuulTestCase):
self.log.debug("Wait for all jobs to finish")
for _ in iterate_timeout(30, 'all jobs finished'):
if len(self.builds) == 1 and len(self.history) == 4:
if len(self.builds) == 1 and len(self.history) == 3:
break
for b in self.builds[:]:
if b.name == 'pre-failure':
@ -6320,7 +6320,6 @@ class TestEarlyFailure(AnsibleZuulTestCase):
self.waitUntilSettled()
self.assertHistory([
dict(name='pre-failure', result=None, changes='1,1'),
dict(name='pre-failure', result=None, changes='1,1'),
dict(name='pre-failure', result=None, changes='1,1'),
dict(name='wait', result='ABORTED', changes='1,1 2,1'),