From c7359b383e75319d6ad863715edd0be7966fc460 Mon Sep 17 00:00:00 2001 From: Yutong Zhang <90831468+yutongzhang-microsoft@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:33:38 +0800 Subject: [PATCH] Add a timeout for acquiring dpkg lock. (#16328) What is the motivation for this PR? In our Impacted Area Based PR testing, we noticed some failure beacuse of the error Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 5166 (dpkg). In this PR, we add a timeout for acquiring dpkg lock to avoid this issue. How did you do it? In this PR, we add a timeout for acquiring dpkg lock to avoid this issue. How did you verify/test it? --- .../impacted_area_testing/calculate-instance-numbers.yml | 2 +- .azure-pipelines/impacted_area_testing/get-impacted-area.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/impacted_area_testing/calculate-instance-numbers.yml b/.azure-pipelines/impacted_area_testing/calculate-instance-numbers.yml index 4c1e17fecd6..fd31348aa6e 100644 --- a/.azure-pipelines/impacted_area_testing/calculate-instance-numbers.yml +++ b/.azure-pipelines/impacted_area_testing/calculate-instance-numbers.yml @@ -11,7 +11,7 @@ steps: - script: | set -x - sudo apt-get update && sudo apt-get install -y jq + sudo apt-get -o DPkg::Lock::Timeout=600 update && sudo apt-get -o DPkg::Lock::Timeout=600 -y install jq TEST_SCRIPTS=$(echo '$(TEST_SCRIPTS)' | jq -r -c '."${{ parameters.TOPOLOGY }}"') diff --git a/.azure-pipelines/impacted_area_testing/get-impacted-area.yml b/.azure-pipelines/impacted_area_testing/get-impacted-area.yml index 6bee00aeee6..03ac2725261 100644 --- a/.azure-pipelines/impacted_area_testing/get-impacted-area.yml +++ b/.azure-pipelines/impacted_area_testing/get-impacted-area.yml @@ -21,7 +21,7 @@ steps: pip install PyYAML pip install natsort - sudo apt-get install -y jq + sudo apt-get -o DPkg::Lock::Timeout=600 -y install jq FINAL_FEATURES="" IFS=' ' read -ra FEATURES_LIST <<< "$(DIFF_FOLDERS)"