Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics: Improve latency network cleanup #8659

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/metrics/network/latency_kubernetes/latency-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ function remove_tmp_file() {

trap remove_tmp_file EXIT

function latency_cleanup() {
info "Latency test cleanup"
kubectl delete -f "${SCRIPT_PATH}/latency-server.yaml"
kubectl delete -f "${SCRIPT_PATH}/latency-client.yaml"
}

function main() {
init_env
cmds=("bc" "jq")
Expand All @@ -44,6 +50,8 @@ function main() {
# Create client
kubectl create -f "${SCRIPT_PATH}/latency-client.yaml"

trap latency_cleanup EXIT

# Get the names of the client pod
export client_pod_name="latency-client"

Expand Down Expand Up @@ -80,9 +88,5 @@ EOF
metrics_json_add_array_element "$json"
metrics_json_end_array "Results"
metrics_json_save

kubectl delete pod "$client_pod_name" "$server_pod_name"
kubectl get pods -A
check_processes
}
main "$@"