From de19e280b2bfb9ca0e31c032819e4af6c3f98805 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 23 Aug 2022 15:05:50 -0700 Subject: [PATCH] More optimizations to not query unused baseline results --- britney2/policies/autopkgtest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index a9414a7..7ff8c1f 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -1284,9 +1284,6 @@ class AutopkgtestPolicy(BasePolicy): target_suite = self.suite_info.target_suite binaries_info = target_suite.binaries[arch] - # determine current test result status - baseline_result = self.result_in_baseline(src, arch)[0] - # determine current test result status until = self.find_max_lower_force_reset_test(src, ver, arch) @@ -1312,6 +1309,9 @@ class AutopkgtestPolicy(BasePolicy): run_id = r[2] if r[0] in {Result.FAIL, Result.OLD_FAIL}: + # determine current test result status + baseline_result = self.result_in_baseline(src, arch)[0] + if baseline_result == Result.FAIL: result = 'ALWAYSFAIL' elif baseline_result in {Result.NONE, Result.OLD_FAIL}: @@ -1369,6 +1369,7 @@ class AutopkgtestPolicy(BasePolicy): except KeyError: # no result for src/arch; still running? if arch in self.pending_tests.get(trigger, {}).get(src, []): + baseline_result = self.result_in_baseline(src, arch)[0] if baseline_result != Result.FAIL and not self.has_force_badtest(src, ver, arch): result = 'RUNNING' else: