Skip to content

Commit aac3175

Browse files
prathamesh0claude
andcommitted
fix(test): wait for namespace termination before restart
Replace fixed sleep with a polling loop that waits for the deployment namespace to be fully deleted. Without this, the start command fails with 403 Forbidden because k8s rejects resource creation in a namespace that is still terminating. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b85c12e commit aac3175

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/k8s-deploy/run-deploy-test.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,15 @@ fi
230230
# Use --delete-volumes to clear PVs so fresh PVCs can bind on restart.
231231
# Bind-mount data survives on the host filesystem; provisioner volumes are recreated fresh.
232232
$TEST_TARGET_SO deployment --dir $test_deployment_dir stop --delete-volumes --skip-cluster-management
233-
sleep 5
233+
# Wait for the namespace to be fully terminated before restarting.
234+
# Without this, 'start' fails with 403 Forbidden because the namespace
235+
# is still in Terminating state.
236+
for i in {1..60}; do
237+
if ! kubectl get namespace laconic-${deployment_id} 2>/dev/null | grep -q .; then
238+
break
239+
fi
240+
sleep 2
241+
done
234242
$TEST_TARGET_SO deployment --dir $test_deployment_dir start --skip-cluster-management
235243
wait_for_pods_started
236244
wait_for_log_output

0 commit comments

Comments
 (0)