Skip to content

Commit

Permalink
hack/test: make tcp-timeout test portable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MichaelEischer committed Nov 4, 2024
1 parent 04d0d9c commit 12d85e5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hack/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 12d85e5

Please sign in to comment.