From 1b869c82379fd91827d66b1a8d22e59fe72ee7a3 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 6 May 2024 11:46:23 -0700 Subject: [PATCH] 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 --- .../config/early-failure/git/common-config/zuul.yaml | 5 +++++ tests/unit/test_v3.py | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/fixtures/config/early-failure/git/common-config/zuul.yaml b/tests/fixtures/config/early-failure/git/common-config/zuul.yaml index 2d1790d4fc..d6ea50a7dd 100644 --- a/tests/fixtures/config/early-failure/git/common-config/zuul.yaml +++ b/tests/fixtures/config/early-failure/git/common-config/zuul.yaml @@ -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: diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py index 7c161f02ec..df9721134f 100644 --- a/tests/unit/test_v3.py +++ b/tests/unit/test_v3.py @@ -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'),