diff --git a/tests/k8s-deploy/run-deploy-test.sh b/tests/k8s-deploy/run-deploy-test.sh index 942110d4..cfc03138 100755 --- a/tests/k8s-deploy/run-deploy-test.sh +++ b/tests/k8s-deploy/run-deploy-test.sh @@ -230,7 +230,15 @@ fi # Use --delete-volumes to clear PVs so fresh PVCs can bind on restart. # Bind-mount data survives on the host filesystem; provisioner volumes are recreated fresh. $TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --skip-cluster-management -sleep 5 +# Wait for the namespace to be fully terminated before restarting. +# Without this, 'start' fails with 403 Forbidden because the namespace +# is still in Terminating state. +for i in {1..60}; do + if ! kubectl get namespace laconic-${deployment_id} 2>/dev/null | grep -q .; then + break + fi + sleep 2 +done $TEST_TARGET_SO deployment --dir $test_deployment_dir start --skip-cluster-management wait_for_pods_started wait_for_log_output