Skip to content

Commit 5d7f662

Browse files
committed
fix: potential for flaky tests
Signed-off-by: Ajay Mishra <[email protected]>
1 parent 8dcc870 commit 5d7f662

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ test-ci:
1515
nohup kubectl port-forward -n nvsentinel svc/simple-health-client 8080:8080 > /dev/null 2>&1 &
1616
kubectl get po -Ao wide
1717
kubectl get no -o wide
18+
@echo "Pre-test: Ensuring MongoDB initialization is complete..."
19+
kubectl wait --for=condition=complete job/create-mongodb-database -n nvsentinel --timeout=5m || true
20+
@echo "Pre-test: Cleaning up any failed pods..."
21+
kubectl delete pods -n nvsentinel --field-selector=status.phase=Failed --ignore-not-found=true || true
22+
@echo "Pre-test: Waiting for fault-quarantine deployment to be available..."
23+
kubectl wait --for=condition=available deployment/nvsentinel-fault-quarantine -n nvsentinel --timeout=5m || true
24+
@sleep 10
25+
@echo "Restarting fault-quarantine deployment..."
1826
kubectl rollout restart deploy -l app.kubernetes.io/name=fault-quarantine -n nvsentinel
27+
@echo "Waiting for deployment rollout to complete..."
28+
kubectl rollout status deployment/nvsentinel-fault-quarantine -n nvsentinel --timeout=10m
1929
$(MAKE) test
2030

2131
# Run end-to-end tests

0 commit comments

Comments
 (0)