refactor (ci/tests): Stop any ongoing processes before retrying to install bbb (#21515)
* Stop any ongoing processes before retrying to install bbb * add rm -f param * Update .github/workflows/automated-tests.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * make cleanup more verbose --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
d11ab481f9
commit
67dac35176
20
.github/workflows/automated-tests.yml
vendored
20
.github/workflows/automated-tests.yml
vendored
@ -292,9 +292,25 @@ jobs:
|
||||
echo "Installation failed with exit code $COMMAND_EXIT_CODE"
|
||||
echo "Retrying installation within $RETRY_INTERVAL seconds..."
|
||||
sleep $RETRY_INTERVAL
|
||||
# Remove lock in case the timeout was during an apt install
|
||||
rm -f /var/lib/dpkg/lock
|
||||
fi
|
||||
echo "Stop any ongoing processes related to apt-get or dpkg that might be stuck"
|
||||
# Use -q to suppress "no process found" messages
|
||||
killall -q apt-get || true
|
||||
killall -q dpkg || true
|
||||
|
||||
echo "Remove the lock files that may have been left behind"
|
||||
# Group lock file removal for better readability
|
||||
rm -f /var/lib/dpkg/lock-frontend
|
||||
rm -f /var/lib/dpkg/lock
|
||||
rm -f /var/cache/apt/archives/lock
|
||||
|
||||
echo "Reconfigure the package manager"
|
||||
dpkg --configure -a
|
||||
|
||||
echo "Clean up any partially installed packages"
|
||||
apt-get clean
|
||||
apt-get autoremove
|
||||
|
||||
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user