Skip to content

Commit 64b370b

Browse files
committed
[tests] Stabilize E2E kubernetes tests
Three changes to reduce flakiness in kubernetes E2E tests: - Increase node Ready timeout from 2m to 5m to accommodate resource-constrained CI runners - Fail fast when nodes are not Ready instead of continuing to LB/NFS tests that will also fail, saving ~7 minutes per attempt - Delete stale Kubernetes resources at test start to ensure retries provision from scratch instead of patching stuck state Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 3119be1 commit 64b370b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎hack/e2e-apps/run-kubernetes.sh‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ run_kubernetes_test() {
44
local port="$3"
55
local k8s_version=$(yq "$version_expr" packages/apps/kubernetes/files/versions.yaml)
66

7+
# Clean up stale resources from a previous failed retry to ensure fresh provisioning
8+
kubectl delete kuberneteses.apps.cozystack.io "${test_name}" \
9+
-n tenant-test --ignore-not-found --timeout=2m || true
10+
711
kubectl apply -f - <<EOF
812
apiVersion: apps.cozystack.io/v1alpha1
913
kind: Kubernetes
@@ -102,10 +106,11 @@ EOF
102106
done
103107
'
104108
# Verify the nodes are ready
105-
if ! kubectl --kubeconfig "tenantkubeconfig-${test_name}" wait node --all --timeout=2m --for=condition=Ready; then
106-
# Additional debug messages
109+
if ! kubectl --kubeconfig "tenantkubeconfig-${test_name}" wait node --all --timeout=5m --for=condition=Ready; then
110+
# Dump debug info and fail fast — no point running LB/NFS tests without Ready nodes
107111
kubectl --kubeconfig "tenantkubeconfig-${test_name}" describe nodes
108112
kubectl -n tenant-test get hr
113+
exit 1
109114
fi
110115
kubectl --kubeconfig "tenantkubeconfig-${test_name}" get nodes -o wide
111116

0 commit comments

Comments
 (0)