From 46c0719e6623605226673977edfe40951914b47d Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 25 Apr 2024 10:51:51 -0700 Subject: [PATCH] Let installedupdatepkgs generation take longer in a container From https://openqa.fedoraproject.org/tests/2594954 it looks like this takes more than three minutes for updates with hundreds of packages when running in a container (in the container build/ validate test). So, let's give it more time in that case. Signed-off-by: Adam Williamson --- lib/utils.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils.pm b/lib/utils.pm index baf947a6..90337a70 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -1244,8 +1244,10 @@ sub advisory_check_nonmatching_packages { return if (get_var("_ACNMP_DONE")); script_run 'touch /tmp/installedupdatepkgs.txt'; my $rpmcmd = "rpm"; + my $timeout = 180; my $wrapper = $args{wrapper}; $rpmcmd = "$wrapper rpm" if ($wrapper); + $timeout = 360 if ($wrapper); # this creates /tmp/installedupdatepkgs.txt as a sorted list of installed # packages with the same name as packages from the update, in the same form # as /mnt/updatepkgs.txt. The '--last | head -1' tries to handle the @@ -1259,7 +1261,7 @@ sub advisory_check_nonmatching_packages { # (we need four to reach bash, and half of them get eaten by perl or # something along the way). Yes, it only works with *single* quotes. Yes, # I hate escaping - script_run 'for pkg in $(cat /mnt/updatepkgnames.txt); do ' . $rpmcmd . ' -q $pkg && ' . $rpmcmd . ' -q $pkg --last | head -1 | cut -d" " -f1 | sed -e \'s,\^,\\\\\\\\^,g\' | xargs ' . $rpmcmd . ' -q --qf "%{SOURCERPM} %{NAME} %{EPOCHNUM} %{VERSION} %{RELEASE}\n" >> /tmp/installedupdatepkgs.txt; done', timeout => 180; + script_run 'for pkg in $(cat /mnt/updatepkgnames.txt); do ' . $rpmcmd . ' -q $pkg && ' . $rpmcmd . ' -q $pkg --last | head -1 | cut -d" " -f1 | sed -e \'s,\^,\\\\\\\\^,g\' | xargs ' . $rpmcmd . ' -q --qf "%{SOURCERPM} %{NAME} %{EPOCHNUM} %{VERSION} %{RELEASE}\n" >> /tmp/installedupdatepkgs.txt; done', timeout => $timeout; script_run 'sort -u -o /tmp/installedupdatepkgs.txt /tmp/installedupdatepkgs.txt'; # for debugging, may as well always upload these, can't hurt anything upload_logs "/tmp/installedupdatepkgs.txt", failok => 1;