From 479662c63e0dfa233a4fcb0887712b6d1802c4dd Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 23 Aug 2022 13:46:41 -0700 Subject: [PATCH] Don't query for baseline results we won't use. britney currently spends a majority of its runtime querying for baseline test results that it won't find, and that it doesn't need. Refactor to eliminate many of these excess queries. --- britney2/policies/autopkgtest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 74429c7..a9414a7 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -1168,11 +1168,12 @@ class AutopkgtestPolicy(BasePolicy): if has_result: result_state = result[0] version = result[1] - baseline = self.result_in_baseline(src, arch) if result_state in {Result.OLD_PASS, Result.OLD_FAIL, Result.OLD_NEUTRAL}: pass elif result_state == Result.FAIL and \ - baseline[0] in {Result.PASS, Result.NEUTRAL, Result.OLD_PASS, Result.OLD_NEUTRAL} and \ + self.result_in_baseline(src, arch)[0] in \ + {Result.PASS, Result.NEUTRAL, Result.OLD_PASS, + Result.OLD_NEUTRAL} and \ self.options.adt_retry_older_than and \ result[3] + int(self.options.adt_retry_older_than) * SECPERDAY < self._now: # We might want to retry this failure, so continue