[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 <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
parent
3119be1996
commit
64b370bfef
1 changed files with 7 additions and 2 deletions
|
|
@ -4,6 +4,10 @@ run_kubernetes_test() {
|
|||
local port="$3"
|
||||
local k8s_version=$(yq "$version_expr" packages/apps/kubernetes/files/versions.yaml)
|
||||
|
||||
# Clean up stale resources from a previous failed retry to ensure fresh provisioning
|
||||
kubectl delete kuberneteses.apps.cozystack.io "${test_name}" \
|
||||
-n tenant-test --ignore-not-found --timeout=2m || true
|
||||
|
||||
kubectl apply -f - <<EOF
|
||||
apiVersion: apps.cozystack.io/v1alpha1
|
||||
kind: Kubernetes
|
||||
|
|
@ -102,10 +106,11 @@ EOF
|
|||
done
|
||||
'
|
||||
# Verify the nodes are ready
|
||||
if ! kubectl --kubeconfig "tenantkubeconfig-${test_name}" wait node --all --timeout=2m --for=condition=Ready; then
|
||||
# Additional debug messages
|
||||
if ! kubectl --kubeconfig "tenantkubeconfig-${test_name}" wait node --all --timeout=5m --for=condition=Ready; then
|
||||
# Dump debug info and fail fast — no point running LB/NFS tests without Ready nodes
|
||||
kubectl --kubeconfig "tenantkubeconfig-${test_name}" describe nodes
|
||||
kubectl -n tenant-test get hr
|
||||
exit 1
|
||||
fi
|
||||
kubectl --kubeconfig "tenantkubeconfig-${test_name}" get nodes -o wide
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue