From 10eed22925a0eee3439f6c6b63dae638ed8b26e5 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Tue, 3 Dec 2024 16:24:01 -0600 Subject: [PATCH] Fix caching of the latest run for the autopkgtest policy --- britney2/policies/autopkgtest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index c7549c8..f4ed401 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -876,7 +876,11 @@ class AutopkgtestPolicy(BasePolicy): continue if run_id > latest_run_id: latest_run_id = run_id - self.latest_run_for_package._cache[arch] = latest_run_id + try: + self.latest_run_for_package._cache[src][arch] = latest_run_id + except KeyError: + self.latest_run_for_package._cache[src] = {arch: latest_run_id} + return latest_run_id latest_run_for_package._cache = collections.defaultdict(dict)