Skip to content

Commit 4b5a4e5

Browse files
committed
Add flake retries for Windows volume expansion tests
Signed-off-by: Eddie Torres <torredil@amazon.com>
1 parent ef4b3ee commit 4b5a4e5

File tree

1 file changed

+51
-10
lines changed

1 file changed

+51
-10
lines changed

hack/e2e/run.sh

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,57 @@ else
138138
set -x
139139
set +e
140140
# kubetest2 looks for deployers/testers in $PATH
141-
PATH="${BIN}:${PATH}" "${BIN}/kubetest2" noop \
142-
--run-id="e2e-kubernetes" \
143-
--test=ginkgo \
144-
-- \
145-
--skip-regex="${GINKGO_SKIP}" \
146-
--focus-regex="${GINKGO_FOCUS}" \
147-
--test-package-version=$(curl -L https://dl.k8s.io/release/stable-${packageVersion}.txt) \
148-
--parallel=${GINKGO_PARALLEL} \
149-
--test-args="-storage.testdriver=${PWD}/manifests.yaml -kubeconfig=${KUBECONFIG} -node-os-distro=${NODE_OS_DISTRO}"
150-
TEST_PASSED=$?
141+
142+
# Regex matching volume expansion tests susceptible to transient failures on Windows due to defragsvc contention
143+
WINDOWS_VOLUME_EXPAND_REGEX="volume-expand|expansion of pvcs created for ephemeral"
144+
145+
if [[ "${WINDOWS}" == true ]]; then
146+
# Pass 1: Run all tests except volume-expand
147+
loudecho "Running non-volume-expand tests (no retries)"
148+
PATH="${BIN}:${PATH}" "${BIN}/kubetest2" noop \
149+
--run-id="e2e-kubernetes" \
150+
--test=ginkgo \
151+
-- \
152+
--skip-regex="${GINKGO_SKIP}|${WINDOWS_VOLUME_EXPAND_REGEX}" \
153+
--focus-regex="${GINKGO_FOCUS}" \
154+
--test-package-version=$(curl -L https://dl.k8s.io/release/stable-${packageVersion}.txt) \
155+
--parallel=${GINKGO_PARALLEL} \
156+
--test-args="-storage.testdriver=${PWD}/manifests.yaml -kubeconfig=${KUBECONFIG} -node-os-distro=${NODE_OS_DISTRO}"
157+
TEST_PASSED=$?
158+
159+
# Pass 2: Run only volume-expand tests with flake retries to tolerate
160+
# transient defragsvc contention on Windows (StorageWMI error 4).
161+
loudecho "Running volume-expand tests (with flake retries)"
162+
PATH="${BIN}:${PATH}" "${BIN}/kubetest2" noop \
163+
--run-id="e2e-kubernetes-volume-expand" \
164+
--test=ginkgo \
165+
-- \
166+
--skip-regex="${GINKGO_SKIP}" \
167+
--focus-regex="${GINKGO_FOCUS}.*(${WINDOWS_VOLUME_EXPAND_REGEX})" \
168+
--test-package-version=$(curl -L https://dl.k8s.io/release/stable-${packageVersion}.txt) \
169+
--parallel=${GINKGO_PARALLEL} \
170+
--ginkgo-args="--flake-attempts=2" \
171+
--test-args="-storage.testdriver=${PWD}/manifests.yaml -kubeconfig=${KUBECONFIG} -node-os-distro=${NODE_OS_DISTRO}"
172+
VOLUME_EXPAND_PASSED=$?
173+
174+
if [[ ${TEST_PASSED} -ne 0 || ${VOLUME_EXPAND_PASSED} -ne 0 ]]; then
175+
if [[ ${VOLUME_EXPAND_PASSED} -ne 0 ]]; then
176+
loudecho "WARNING: Volume expansion tests failed."
177+
fi
178+
TEST_PASSED=1
179+
fi
180+
else
181+
PATH="${BIN}:${PATH}" "${BIN}/kubetest2" noop \
182+
--run-id="e2e-kubernetes" \
183+
--test=ginkgo \
184+
-- \
185+
--skip-regex="${GINKGO_SKIP}" \
186+
--focus-regex="${GINKGO_FOCUS}" \
187+
--test-package-version=$(curl -L https://dl.k8s.io/release/stable-${packageVersion}.txt) \
188+
--parallel=${GINKGO_PARALLEL} \
189+
--test-args="-storage.testdriver=${PWD}/manifests.yaml -kubeconfig=${KUBECONFIG} -node-os-distro=${NODE_OS_DISTRO}"
190+
TEST_PASSED=$?
191+
fi
151192
set -e
152193
set +x
153194
popd

0 commit comments

Comments
 (0)