Skip to content

Commit f056ffd

Browse files
[AUTO-CHERRYPICK] Set ptest retries to 1 for PR package build check. - branch main (#10215)
Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>
1 parent a3fedc4 commit f056ffd

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

.pipelines/prchecks/PackageBuildPRCheck.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ extends:
107107
steps:
108108
- template: .pipelines/templates/PackageBuild.yml@self
109109
parameters:
110+
checkBuildRetries: "1"
110111
customToolchainArtifactName: $(toolchainArtifactName)
111112
isCheckBuild: true
112113
isQuickRebuildPackages: true

.pipelines/templates/PackageBuild.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ parameters:
66
type: string
77
default: "$(Build.SourcesDirectory)"
88

9+
- name: checkBuildRetries
10+
type: string
11+
default: ""
12+
913
- name: concurrentPackageBuilds
1014
type: number
1115
default: 12
@@ -22,10 +26,6 @@ parameters:
2226
type: string
2327
default: ""
2428

25-
- name: testRerunList
26-
type: string
27-
default: ""
28-
2929
- name: failOnTestFailures
3030
type: boolean
3131
default: true
@@ -125,6 +125,10 @@ parameters:
125125
type: string
126126
default: ""
127127

128+
- name: testRerunList
129+
type: string
130+
default: ""
131+
128132
- name: testSuiteName
129133
type: string
130134
default: "Package test"
@@ -176,6 +180,10 @@ steps:
176180
displayName: "Populate cache RPMs"
177181
178182
- script: |
183+
if [[ -n "${{ parameters.checkBuildRetries }}" ]]; then
184+
check_build_retries_arg="CHECK_BUILD_RETRIES=${{ parameters.checkBuildRetries }}"
185+
fi
186+
179187
if [[ ${{ parameters.isDeltaBuild }} == "true" ]]; then
180188
delta_fetch_arg="DELTA_FETCH=y"
181189
elif [[ ${{ parameters.isDeltaBuild }} == "false" ]]; then
@@ -217,6 +225,7 @@ steps:
217225
SPECS_DIR="${{ parameters.buildRepoRoot }}/${{ parameters.specsFolderPath }}" \
218226
SRPM_PACK_LIST="${{ parameters.srpmPackList }}" \
219227
TEST_RERUN_LIST="${{ parameters.testRerunList }}" \
228+
$check_build_retries_arg \
220229
$delta_fetch_arg \
221230
$max_cascading_rebuilds_arg \
222231
$quick_rebuild_packages_arg \

toolkit/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ PACKAGE_CACHE_SUMMARY ?=
5353
IMAGE_CACHE_SUMMARY ?=
5454
INITRD_CACHE_SUMMARY ?=
5555
PACKAGE_ARCHIVE ?=
56-
PACKAGE_BUILD_RETRIES ?= 1
57-
CHECK_BUILD_RETRIES ?= 1
56+
PACKAGE_BUILD_RETRIES ?= 0
57+
CHECK_BUILD_RETRIES ?= 0
5858
EXTRA_BUILD_LAYERS ?= 0
5959
REFRESH_WORKER_CHROOT ?= y
6060
# Set to 0 to use the number of logical CPUs.

toolkit/scripts/pkggen.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ $(STATUS_FLAGS_DIR)/build-rpms.flag: $(no_repo_acl) $(preprocessed_file) $(chroo
285285
--distro-release-version="$(RELEASE_VERSION)" \
286286
--distro-build-number="$(BUILD_NUMBER)" \
287287
--rpmmacros-file="$(TOOLCHAIN_MANIFESTS_DIR)/macros.override" \
288-
--build-attempts="$(PACKAGE_BUILD_RETRIES)" \
289-
--check-attempts="$(CHECK_BUILD_RETRIES)" \
288+
--build-attempts="$$(($(PACKAGE_BUILD_RETRIES)+1))" \
289+
--check-attempts="$$(($(CHECK_BUILD_RETRIES)+1))" \
290290
$(if $(MAX_CASCADING_REBUILDS),--max-cascading-rebuilds="$(MAX_CASCADING_REBUILDS)") \
291291
--extra-layers="$(EXTRA_BUILD_LAYERS)" \
292292
--build-agent="chroot-agent" \

toolkit/tools/scheduler/schedulerutils/buildworker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func testSRPMFile(agent buildagents.BuildAgent, checkAttempts int, basePackageNa
312312
}, checkAttempts, retryDuration)
313313

314314
if checkFailed {
315-
logger.Log.Debugf("Tests failed for '%s' after %d retries.", basePackageName, checkAttempts)
315+
logger.Log.Debugf("Tests failed for '%s' after %d attempt(s).", basePackageName, checkAttempts)
316316
err = nil
317317
}
318318
return

0 commit comments

Comments
 (0)