test-log-collect: Disable repositories when collecting installed pkgs on SUSE

zypper performs some network operations when collecting the list of
installed packages which slow down the overall process. We already have
the per host list of repositories so we can do some maths to figure out
where each package is coming from.

As we see below, disabling the repositories saves us ~9s.
~$ time zypper --quiet pa -i
real    0m10.607s
user    0m9.024s
sys     0m0.193s

~$ time zypper --disable-repositories pa -i
real    0m1.043s
user    0m0.833s
sys     0m0.136s

On a deployment with multiple containers, the 9s difference causes a lot
of overhead and jobs are timing out from time to time. As such, lets
just disable the repositories when collecting the list of the installed
packages.

Change-Id: I3e48dad0e213f6e24a2ceb4033b1a53873b6e298
This commit is contained in:
Markos Chandras 2018-10-23 11:36:52 +01:00
parent 586ee2c967
commit 0ecb859b96
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ function repo_information {
# SUSE package debugging
elif eval sudo ${lxc_cmd} which zypper &>/dev/null; then
eval sudo ${lxc_cmd} zypper lr -d > "${WORKING_DIR}/logs/suse-zypper-repolist-${1}.txt" || true
eval sudo ${lxc_cmd} zypper pa -i > "${WORKING_DIR}/logs/suse-zypper-list-installed-${1}.txt" || true
eval sudo ${lxc_cmd} zypper --disable-repositories pa -i > "${WORKING_DIR}/logs/suse-zypper-list-installed-${1}.txt" || true
# Ubuntu package debugging
elif eval sudo ${lxc_cmd} which apt-get &> /dev/null; then