Remove retry routines from mixed_build

The retry routines are added for testing purpose (aosp/730971).
We may now remove this because it has no effect to remove the flaky
build errors.

Bug: 112250435
Test: build_mixed system_dir device_dir out_dir
Change-Id: Ibdefb7da3188ce42b6cd2deb5e40ad777c2fe5b0
This commit is contained in:
Justin Yun
2018-10-05 14:24:12 +09:00
parent 10fc92d276
commit 83631d69d8

View File

@@ -80,32 +80,17 @@ readonly DIST_DIR="$3"
readonly CHECK_TOOL="$4" readonly CHECK_TOOL="$4"
readonly TEMP_DIR="$(mktemp -d /tmp/"$(basename $0)"_XXXXXXXX)" readonly TEMP_DIR="$(mktemp -d /tmp/"$(basename $0)"_XXXXXXXX)"
# Retry command until a certain limit. readonly SYSTEM_TARGET_FILES_ARCHIVE="$(find "$SYSTEM_DIR" -name "*-target_files-*.zip" -print)"
# Usage: retry "command"
retry () {
NEXT_WAIT_TIME=0
until ($1 && [[ -n "$($1)" ]]) || [[ $NEXT_WAIT_TIME -eq 4 ]]; do
sleep $(( ++NEXT_WAIT_TIME ))
done
}
command="find "$SYSTEM_DIR" -name "*-target_files-*.zip" -print"
retry "$command"
readonly SYSTEM_TARGET_FILES_ARCHIVE="$($command)"
if [[ ! -f "$SYSTEM_TARGET_FILES_ARCHIVE" ]]; then if [[ ! -f "$SYSTEM_TARGET_FILES_ARCHIVE" ]]; then
exit_badparam "Could not find system target files archive in $SYSTEM_DIR." exit_badparam "Could not find system target files archive in $SYSTEM_DIR."
fi fi
command="find "$DEVICE_DIR" -name "*-img-*.zip" -print" readonly DEVICE_ARCHIVE="$(find "$DEVICE_DIR" -name "*-img-*.zip" -print)"
retry "$command"
readonly DEVICE_ARCHIVE="$($command)"
if [[ ! -f "$DEVICE_ARCHIVE" ]]; then if [[ ! -f "$DEVICE_ARCHIVE" ]]; then
exit_badparam "Could not find device img archive in $DEVICE_DIR." exit_badparam "Could not find device img archive in $DEVICE_DIR."
fi fi
command="find "$DEVICE_DIR" -name "*-target_files-*.zip" -print" readonly DEVICE_TARGET_FILES_ARCHIVE="$(find "$DEVICE_DIR" -name "*-target_files-*.zip" -print)"
retry "$command"
readonly DEVICE_TARGET_FILES_ARCHIVE="$($command)"
if [[ ! -f "$DEVICE_TARGET_FILES_ARCHIVE" ]]; then if [[ ! -f "$DEVICE_TARGET_FILES_ARCHIVE" ]]; then
exit_badparam "Could not find device target_files archive in $DEVICE_DIR." exit_badparam "Could not find device target_files archive in $DEVICE_DIR."
fi fi