From ac6b0c1ba780913a5626b3e08e2c56f0d8454248 Mon Sep 17 00:00:00 2001 From: Tim Andersson Date: Fri, 12 Jul 2024 12:48:42 +0100 Subject: [PATCH] fix: don't queue unnecessary tests on i386 Recent investigations indicated that approximately 85% of all of the i386 tests run at autopkgtest.ubuntu.com are pointless. These tests are pointless for the following reason: for end users, the dependencies of an arch: all package on non-arch: all packages are satisfied by the amd64 binaries, not i386 binaries. This commit introduces a check in the `tests_for_source` function, which is the function that generates a list of tests to be requested for a src package on a specified architecture. The check itself takes the src package name, gets the list of binaries for that src package and checks to see if the architecture for all of the binaries of said src package is "all". If all the binaries are Architecture: "all", then the function returns an empty list and no tests will be requested for that src package on i386. Since it's quite hard to test britney code, the implementation is wrapped in a try except block as to avoid tracebacks blocking britney runs. The try except block should be removed once the change is considered to be stable. --- britney2/policies/autopkgtest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 87df958..44ea436 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -699,6 +699,22 @@ class AutopkgtestPolicy(BasePolicy): reported_pkgs = set() tests = [] + # We don't want to run tests for src packages on i386 if all of the binary packages + # have Architecture: all. These are redundant for real world use cases as these deps + # are satisfied by amd64 binaries + try: + if arch == "i386": + all_binaries_arch_all = True + for pkg_id in source_suite.sources[src]: + if pkg_id.architecture != "all": + all_binaries_arch_all = False + if all_binaries_arch_all: + self.logger.info('Source package %s has binaries which are all Architecture: all, and tests have been requested on %s, not running any tests for this src package', + src, + arch) + return tests + except Exception as e: + self.logger.error('i386 useless autopkgtest check failed with: %s', e) # gcc-N triggers tons of tests via libgcc1, but this is mostly in vain: # gcc already tests itself during build, and it is being used from