From 12d85e5d87514e845ddba9e32794b15652ebcac0 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 4 Nov 2024 12:45:19 +0100 Subject: [PATCH] hack/test: make tcp-timeout test portable At least on Linux nc does not automatically close the sending side of the connection when the receiving side is closed by yawol. Extend the test to send a message after the idle timeout to trigger a forceful close of the sending side of the connection. --- hack/tests/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hack/tests/README.md b/hack/tests/README.md index eb4db4e2..b0bc104c 100644 --- a/hack/tests/README.md +++ b/hack/tests/README.md @@ -49,11 +49,17 @@ echo "test" | nc -u $(kubectl get services udp-timeout --output jsonpath='{.sta ## tcp-timeout -This command should be closed in 10 sec +This command should be closed with no output in approximately 10 sec + +Bash: ``` -time nc $(kubectl get services tcp-timeout --output jsonpath='{.status.loadBalancer.ingress[0].ip}') 80 +time nc $(kubectl get services tcp-timeout --output jsonpath='{.status.loadBalancer.ingress[0].ip}') 80 < <( sleep 11; echo "test" ) ``` +Zsh: +``` +{ sleep 11; echo "test" } | time nc $(kubectl get services tcp-timeout --output jsonpath='{.status.loadBalancer.ingress[0].ip}') 80 +``` ## cleanup