From b73a7ca1d3afd417cdea91812da2cac75997ec7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 19 Aug 2026 15:42:27 -0300 Subject: [PATCH] fix(ci): bound the apt network steps with timeouts and retries The PR test job ran apt-get against the xcat.org repository with no time limit of its own. When the repository stalled, the job hung on the update step until the sixty minute workflow limit canceled the run, and the log gave no reason. Wrap the apt-get update and install steps in a timeout command and give apt a transfer timeout with retries. A stalled repository now fails the step in minutes, the driver prints its install error report, and a rerun is possible at once. --- github_action_xcat_test.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github_action_xcat_test.pl b/github_action_xcat_test.pl index dd8eed589..53e118fbf 100644 --- a/github_action_xcat_test.pl +++ b/github_action_xcat_test.pl @@ -352,7 +352,7 @@ sub install_xcat{ "sudo chmod 777 /etc/apt/sources.list", "sudo echo \"deb [arch=amd64 allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/latest/xcat-dep noble main\" >> /etc/apt/sources.list", "sudo echo \"deb [arch=ppc64el allow-insecure=yes] http://xcat.org/files/xcat/repos/apt/latest/xcat-dep noble main\" >> /etc/apt/sources.list", - "sudo apt-get -qq --allow-insecure-repositories update"); + "sudo timeout 600 apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 --allow-insecure-repositories update"); chdir $ENV{RUNNER_WORKSPACE};; my @output; @@ -369,7 +369,7 @@ sub install_xcat{ } } - my $cmd = "sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y xcat --allow-remove-essential --allow-unauthenticated"; + my $cmd = "sudo timeout 1200 env DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 install -y xcat --allow-remove-essential --allow-unauthenticated"; @output = runcmd("$cmd"); if($::RUNCMD_RC){ my $lastline = $output[-1]; @@ -404,7 +404,7 @@ sub install_xcat{ print "[install_xcat] $cmd....[Pass]\n"; } } - $cmd = "sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y xcat-probe --allow-remove-essential --allow-unauthenticated"; + $cmd = "sudo timeout 1200 env DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 install -y xcat-probe --allow-remove-essential --allow-unauthenticated"; @output = runcmd("$cmd"); if($::RUNCMD_RC){ print RED "[install_xcat] $cmd ....[Failed]\n"; @@ -510,7 +510,7 @@ sub check_syntax{ # Return code: #-------------------------------------------------------- sub run_fast_regression_test{ - my $cmd = "sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y xcat-test --allow-remove-essential --allow-unauthenticated"; + my $cmd = "sudo timeout 1200 env DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -o Acquire::http::Timeout=30 install -y xcat-test --allow-remove-essential --allow-unauthenticated"; my @output = runcmd("$cmd"); if($::RUNCMD_RC){ print RED "[run_fast_regression_test] $cmd ....[Failed]\n";