@@ -16,28 +16,21 @@ mock::kubelet 1.29.0
1616DEFAULT_MAX_ATTEMPTS=3
1717CONNECTION_TIMEOUT=30
1818
19- # ensure the max retry attempts can be overridden with the standard env var
20- # we have to test with values that are different from the default
21- MAX_ATTEMPTS_VALUES=(1 2)
22-
23- for MAX_ATTEMPTS_VALUE in " ${MAX_ATTEMPTS_VALUES[@]} " ; do
24- if [ " $MAX_ATTEMPTS_VALUE " = " $DEFAULT_MAX_ATTEMPTS " ]; then
25- echo " We can't test with a value ($MAX_ATTEMPTS_VALUE ) that is the same as the default!"
26- exit 1
27- fi
28- echo " testing with MAX_ATTEMPTS=${MAX_ATTEMPTS_VALUE} "
29- START=$( date +%s)
30- AWS_MAX_ATTEMPTS=${MAX_ATTEMPTS_VALUE} nodeadm init --development --skip run --config-source file://config.yaml || true
31- END=$( date +%s)
32- SECONDS_ELAPSED=$(( END - START))
33- LOWER_BOUND=$(( MAX_ATTEMPTS_VALUE * CONNECTION_TIMEOUT))
34- UPPER_BOUND=$(( LOWER_BOUND + 5 ))
35- echo " MAX_ATTEMPTS=${MAX_ATTEMPTS_VALUE} SECONDS_ELAPSED=${SECONDS_ELAPSED} , LOWER_BOUND=${LOWER_BOUND} , UPPER_BOUND=${UPPER_BOUND} "
36- if ! (( SECONDS_ELAPSED >= LOWER_BOUND && SECONDS_ELAPSED <= UPPER_BOUND)) ; then
37- echo " The observed AWS SDK retry behavior did not fall within the expected range!"
38- exit 1
39- fi
40- done
19+ # This must be different from either our default of 30 or the aws default of 3.
20+ MAX_ATTEMPTS_VALUE=1
21+
22+ echo " testing with MAX_ATTEMPTS=${MAX_ATTEMPTS_VALUE} "
23+ START=$( date +%s)
24+ AWS_MAX_ATTEMPTS=${MAX_ATTEMPTS_VALUE} nodeadm init --development --skip run --config-source file://config.yaml || true
25+ END=$( date +%s)
26+ SECONDS_ELAPSED=$(( END - START))
27+ LOWER_BOUND=$(( MAX_ATTEMPTS_VALUE * CONNECTION_TIMEOUT))
28+ UPPER_BOUND=$(( LOWER_BOUND + 5 ))
29+ echo " MAX_ATTEMPTS=${MAX_ATTEMPTS_VALUE} SECONDS_ELAPSED=${SECONDS_ELAPSED} , LOWER_BOUND=${LOWER_BOUND} , UPPER_BOUND=${UPPER_BOUND} "
30+ if ! (( SECONDS_ELAPSED >= LOWER_BOUND && SECONDS_ELAPSED <= UPPER_BOUND)) ; then
31+ echo " The observed AWS SDK retry behavior did not fall within the expected range!"
32+ exit 1
33+ fi
4134
4235# now, we need to make sure that if no override is specified,
4336# we use our increased number of attempts instead of the default
0 commit comments