Skip to content

Commit

Permalink
Merge pull request #212 from fission/test-fixes
Browse files Browse the repository at this point in the history
Force k8s object removal in e2e cleanup
  • Loading branch information
erwinvaneyk authored Sep 21, 2018
2 parents d74b30c + ed09b58 commit 27931c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 7 additions & 7 deletions test/e2e/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ cleanup_fission() {

emph "Removing custom resources..."
clean_tpr_crd_resources || true
kubectl delete all --all -n ${NS}
kubectl delete all --all -n ${NS_FUNCTION}
kubectl delete all --all -n ${NS_BUILDER}
kubectl delete all --force --now --all -n ${NS}
kubectl delete all --force --now --all -n ${NS_FUNCTION}
kubectl delete all --force --now --all -n ${NS_BUILDER}


# Trigger deletion of all namespaces before waiting - for concurrency of deletion
emph "Forcing deletion of namespaces..."
kubectl delete ns/${NS} --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_BUILDER} --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_FUNCTION} --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS} --force --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_BUILDER} --force --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete
kubectl delete ns/${NS_FUNCTION} --force --now > /dev/null 2>&1 # Sometimes it is not deleted by helm delete

# Wait until all namespaces are actually deleted!
emph "Awaiting deletion of namespaces..."
verify_ns_deleted() {
kubectl delete ns/${1} --now 2>&1 | grep -qv "Error from server (Conflict):"
kubectl delete ns/${1} --force --now 2>&1 | grep -qv "Error from server (Conflict):"
}
# Namespaces sometimes take a long time to delete for some reason
sleep 10
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/tests/test_inputs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail
set -exuo pipefail

EXAMPLE_DIR=$(dirname $0)/../../../examples/misc

Expand All @@ -9,7 +9,6 @@ cleanup() {
}
trap cleanup EXIT

fission env create --name binary --image fission/binary-env:latest || true
fission fn create --name inputs --env workflow --src ${EXAMPLE_DIR}/inputs.wf.yaml
sleep 5 # TODO remove this once we can initiate synchronous commands
fission fn test --name inputs -b 'foobar' -H 'HEADER_KEY: HEADER_VAL' --method PUT \
Expand Down

0 comments on commit 27931c0

Please sign in to comment.