Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,14 @@ kubectl -n "${SYSTEM_NAMESPACE}" patch configmap/config-leader-election --type=m
add_trap "kubectl get cm config-leader-election -n ${SYSTEM_NAMESPACE} -oyaml | sed '/.*enabledComponents.*/d' | kubectl replace -f -" SIGKILL SIGTERM SIGQUIT

# Save activator HPA original values for later use.
min_replicas=$(kubectl get hpa activator -n "${SYSTEM_NAMESPACE}" -ojsonpath='{.spec.minReplicas}')
max_replicas=$(kubectl get hpa activator -n "${SYSTEM_NAMESPACE}" -ojsonpath='{.spec.maxReplicas}')
hpa_template='{"spec": {"maxReplicas": %s, "minReplicas": %s}}'
hpa_spec=$(echo '{"spec": {'$(kubectl get hpa activator -n "knative-serving" -ojsonpath='"minReplicas": {.spec.minReplicas}, "maxReplicas": {.spec.maxReplicas}')'}}')

kubectl patch hpa activator -n "${SYSTEM_NAMESPACE}" \
--type "merge" \
--patch "$(printf "$hpa_template" "2" "2")" || failed=1
--patch '{"spec": {"minReplicas": 2, "maxReplicas": 2}}' || failed=1
add_trap "kubectl patch hpa activator -n ${SYSTEM_NAMESPACE} \
--type 'merge' \
--patch $(printf "$hpa_template" "$max_replicas" "$min_replicas")" SIGKILL SIGTERM SIGQUIT
--patch $hpa_spec" SIGKILL SIGTERM SIGQUIT

for deployment in controller autoscaler-hpa webhook; do
# Make sure all pods run in leader-elected mode.
Expand Down Expand Up @@ -170,15 +168,6 @@ fi
# Define short -spoofinterval to ensure frequent probing while stopping pods
go_test_e2e -timeout=15m -failfast -parallel=1 ./test/ha -spoofinterval="10ms" || failed=1

kubectl get cm config-leader-election -n "${SYSTEM_NAMESPACE}" -oyaml | sed '/.*enabledComponents.*/d' | kubectl replace -f -
for deployment in controller autoscaler-hpa; do
kubectl -n "${SYSTEM_NAMESPACE}" scale deployment "$deployment" --replicas=0
kubectl -n "${SYSTEM_NAMESPACE}" scale deployment "$deployment" --replicas=1
done
kubectl patch hpa activator -n "${SYSTEM_NAMESPACE}" \
--type "merge" \
--patch "$(printf "$hpa_template" "2" "2")"

# Dump cluster state in case of failure
(( failed )) && dump_cluster_state
(( failed )) && fail_test
Expand Down