From 1449e9120aa0e12587d4ed36758c8dfaf778c15f Mon Sep 17 00:00:00 2001 From: Pawel Winogrodzki Date: Wed, 4 Sep 2024 13:46:13 -0700 Subject: [PATCH] Set ptest retries to 1 for PR package build check. (CP: #10133) (#10219) --- .pipelines/prchecks/PackageBuildPRCheck.yml | 3 ++- .pipelines/templates/PackageBuild.yml | 17 +++++++++++++---- toolkit/Makefile | 4 ++-- toolkit/scripts/pkggen.mk | 4 ++-- .../scheduler/schedulerutils/buildworker.go | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.pipelines/prchecks/PackageBuildPRCheck.yml b/.pipelines/prchecks/PackageBuildPRCheck.yml index 6317ac36e9c..efd95d11474 100644 --- a/.pipelines/prchecks/PackageBuildPRCheck.yml +++ b/.pipelines/prchecks/PackageBuildPRCheck.yml @@ -102,6 +102,7 @@ extends: steps: - template: .pipelines/templates/PackageBuild.yml@self parameters: + checkBuildRetries: "1" customToolchainArtifactName: $(toolchainArtifactNameBase)_${{ configuration.name }} isCheckBuild: true isQuickRebuildPackages: true @@ -109,8 +110,8 @@ extends: maxCPU: "${{ configuration.maxCPUs }}" pipArtifactFeeds: "mariner/Mariner-Pypi-Feed" selfRepoName: self - testSuiteName: "[${{ configuration.name }}] Package test" testRerunList: "$(testListFromToolchain)" + testSuiteName: "[${{ configuration.name }}] Package test" - task: PublishPipelineArtifact@1 inputs: diff --git a/.pipelines/templates/PackageBuild.yml b/.pipelines/templates/PackageBuild.yml index 02964e0bc77..ca3038450a5 100644 --- a/.pipelines/templates/PackageBuild.yml +++ b/.pipelines/templates/PackageBuild.yml @@ -6,6 +6,10 @@ parameters: type: string default: "$(Build.SourcesDirectory)" + - name: checkBuildRetries + type: string + default: "" + - name: concurrentPackageBuilds type: number default: 12 @@ -22,10 +26,6 @@ parameters: type: string default: "" - - name: testRerunList - type: string - default: "" - - name: failOnTestFailures type: boolean default: true @@ -125,6 +125,10 @@ parameters: type: string default: "" + - name: testRerunList + type: string + default: "" + - name: testSuiteName type: string default: "Package test" @@ -176,6 +180,10 @@ steps: displayName: "Populate cache RPMs" - script: | + if [[ -n "${{ parameters.checkBuildRetries }}" ]]; then + check_build_retries_arg="CHECK_BUILD_RETRIES=${{ parameters.checkBuildRetries }}" + fi + if [[ ${{ parameters.isDeltaBuild }} == "true" ]]; then delta_fetch_arg="DELTA_FETCH=y" elif [[ ${{ parameters.isDeltaBuild }} == "false" ]]; then @@ -217,6 +225,7 @@ steps: SPECS_DIR="${{ parameters.buildRepoRoot }}/${{ parameters.specsFolderPath }}" \ SRPM_PACK_LIST="${{ parameters.srpmPackList }}" \ TEST_RERUN_LIST="${{ parameters.testRerunList }}" \ + $check_build_retries_arg \ $delta_fetch_arg \ $max_cascading_rebuilds_arg \ $quick_rebuild_packages_arg \ diff --git a/toolkit/Makefile b/toolkit/Makefile index 46578880973..d97ca77b9d9 100644 --- a/toolkit/Makefile +++ b/toolkit/Makefile @@ -53,8 +53,8 @@ PACKAGE_CACHE_SUMMARY ?= IMAGE_CACHE_SUMMARY ?= INITRD_CACHE_SUMMARY ?= PACKAGE_ARCHIVE ?= -PACKAGE_BUILD_RETRIES ?= 1 -CHECK_BUILD_RETRIES ?= 1 +PACKAGE_BUILD_RETRIES ?= 0 +CHECK_BUILD_RETRIES ?= 0 EXTRA_BUILD_LAYERS ?= 0 REFRESH_WORKER_CHROOT ?= y # Set to 0 to use the number of logical CPUs. diff --git a/toolkit/scripts/pkggen.mk b/toolkit/scripts/pkggen.mk index 8b45ac40925..3e5c8c367ca 100644 --- a/toolkit/scripts/pkggen.mk +++ b/toolkit/scripts/pkggen.mk @@ -287,8 +287,8 @@ $(STATUS_FLAGS_DIR)/build-rpms.flag: $(no_repo_acl) $(preprocessed_file) $(chroo --distro-release-version="$(RELEASE_VERSION)" \ --distro-build-number="$(BUILD_NUMBER)" \ --rpmmacros-file="$(TOOLCHAIN_MANIFESTS_DIR)/macros.override" \ - --build-attempts="$(PACKAGE_BUILD_RETRIES)" \ - --check-attempts="$(CHECK_BUILD_RETRIES)" \ + --build-attempts="$$(($(PACKAGE_BUILD_RETRIES)+1))" \ + --check-attempts="$$(($(CHECK_BUILD_RETRIES)+1))" \ $(if $(MAX_CASCADING_REBUILDS),--max-cascading-rebuilds="$(MAX_CASCADING_REBUILDS)") \ --extra-layers="$(EXTRA_BUILD_LAYERS)" \ --build-agent="chroot-agent" \ diff --git a/toolkit/tools/scheduler/schedulerutils/buildworker.go b/toolkit/tools/scheduler/schedulerutils/buildworker.go index 7666b5e2b7e..62d5b803d8e 100644 --- a/toolkit/tools/scheduler/schedulerutils/buildworker.go +++ b/toolkit/tools/scheduler/schedulerutils/buildworker.go @@ -314,7 +314,7 @@ func testSRPMFile(agent buildagents.BuildAgent, checkAttempts int, basePackageNa }, checkAttempts, retryDuration) if checkFailed { - logger.Log.Debugf("Tests failed for '%s' after %d retries.", basePackageName, checkAttempts) + logger.Log.Debugf("Tests failed for '%s' after %d attempt(s).", basePackageName, checkAttempts) err = nil } return