Skip to content

Commit

Permalink
increase k8s tests timeout by 3 times
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Prendes <[email protected]>
  • Loading branch information
jprendes committed Oct 31, 2024
1 parent 4234ea6 commit b63511a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/action-test-k3s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
name: test-img
path: dist
- name: run
timeout-minutes: 5
timeout-minutes: 15
run: make test/k3s-${{ inputs.runtime }}
# only runs when the previous step fails
- name: inspect failed pods
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/action-test-kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
name: test-${{ inputs.image }}
path: dist
- name: run
timeout-minutes: 7
timeout-minutes: 21
run: ${{ inputs.test-command }}
# only runs when the previous step fails
- name: inspect failed pods
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -244,39 +244,39 @@ test/k8s/cluster-%: dist/img.tar bin/kind test/k8s/_out/img-%
.PHONY: test/k8s/deploy-workload-%
test/k8s/deploy-workload-%: test/k8s/clean test/k8s/cluster-%
kubectl --context=kind-$(KIND_CLUSTER_NAME) apply -f test/k8s/deploy.yaml
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=90s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=270s
# verify that we are still running after some time
sleep 5s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=15s

.PHONY: test/k8s/deploy-workload-oci-%
test/k8s/deploy-workload-oci-%: test/k8s/clean test/k8s/cluster-% dist/img-oci.tar dist/img-oci-artifact.tar test/k8s/cluster-%
bin/kind load image-archive --name $(KIND_CLUSTER_NAME) dist/img-oci.tar
bin/kind load image-archive --name $(KIND_CLUSTER_NAME) dist/img-oci-artifact.tar
kubectl --context=kind-$(KIND_CLUSTER_NAME) apply -f test/k8s/deploy.oci.yaml
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=90s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=270s
# verify that we are still running after some time
sleep 5s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=15s
@if [ "$*" = "wasmtime" ]; then \
set -e; \
echo "checking for pre-compiled labels and ensuring can scale after pre-compile"; \
docker exec $(KIND_CLUSTER_NAME)-control-plane ctr -n k8s.io content ls | grep "runwasi.io/precompiled"; \
kubectl --context=kind-$(KIND_CLUSTER_NAME) scale deployment wasi-demo --replicas=4; \
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=5s; \
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for condition=Available=True --timeout=15s; \
fi

.PHONY: test/k8s-%
test/k8s-%: test/k8s/deploy-workload-%
# verify that we are able to delete the deployment
kubectl --context=kind-$(KIND_CLUSTER_NAME) delete -f test/k8s/deploy.yaml
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for delete --timeout=60s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for delete --timeout=180s

.PHONY: test/k8s-oci-%
test/k8s-oci-%: test/k8s/deploy-workload-oci-%
# verify that we are able to delete the deployment
kubectl --context=kind-$(KIND_CLUSTER_NAME) delete -f test/k8s/deploy.oci.yaml
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for delete --timeout=60s
kubectl --context=kind-$(KIND_CLUSTER_NAME) wait deployment wasi-demo --for delete --timeout=180s

.PHONY: test/k8s/clean
test/k8s/clean: bin/kind
Expand All @@ -297,34 +297,34 @@ test/k3s-%: dist/img.tar bin/k3s dist-%
sudo bin/k3s kubectl get pods --all-namespaces
sudo bin/k3s kubectl apply -f test/k8s/deploy.yaml
sudo bin/k3s kubectl get pods --all-namespaces
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=120s
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=360s
# verify that we are still running after some time
sleep 5s
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=5s
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=15s
sudo bin/k3s kubectl get pods -o wide
sudo bin/k3s kubectl delete -f test/k8s/deploy.yaml
sudo bin/k3s kubectl wait deployment wasi-demo --for delete --timeout=60s
sudo bin/k3s kubectl wait deployment wasi-demo --for delete --timeout=180s

.PHONY: test/k3s-oci-%
test/k3s-oci-%: dist/img-oci.tar bin/k3s dist-%
sudo bash -c -- 'while ! timeout 40 test/k3s/bootstrap.sh "$*" dist/img-oci.tar; do $(MAKE) bin/k3s/clean bin/k3s; done'
sudo bin/k3s kubectl get pods --all-namespaces
sudo bin/k3s kubectl apply -f test/k8s/deploy.oci.yaml
sudo bin/k3s kubectl get pods --all-namespaces
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=120s
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=360s
# verify that we are still running after some time
sleep 5s
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=5s
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=15s
sudo bin/k3s kubectl get pods -o wide
@if [ "$*" = "wasmtime" ]; then \
set -e; \
echo "checking for pre-compiled labels and ensuring can scale"; \
sudo bin/k3s ctr -n k8s.io content ls | grep "runwasi.io/precompiled"; \
sudo bin/k3s kubectl scale deployment wasi-demo --replicas=4; \
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=5s; \
sudo bin/k3s kubectl wait deployment wasi-demo --for condition=Available=True --timeout=15s; \
fi
sudo bin/k3s kubectl delete -f test/k8s/deploy.oci.yaml
sudo bin/k3s kubectl wait deployment wasi-demo --for delete --timeout=60s
sudo bin/k3s kubectl wait deployment wasi-demo --for delete --timeout=180s

.PHONY: test/k3s/clean
test/k3s/clean: bin/k3s/clean;
Expand Down

0 comments on commit b63511a

Please sign in to comment.