From 72fbe306b6a327d13ed9f52aa464d39f5b39c654 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 17 Jul 2025 00:17:27 +0800 Subject: [PATCH] test: remove curl retry in favor of keep-alive (#9888) At present, the `direct-download-roaming-network` integration test is a bit odd. It uses the `--retry` switch from `curl` to retry the download once it failed. However, what we want to show with this integration test is that a TCP connection can survive network roaming. We can show that successfully but only if we specify the `--keepalive-time` option, otherwise the download stalls. From inspecting the network logs, this is because `curl` simply waits for more data to be downloaded. After a network reset, the connection however is gone and the _client_ (in this case `curl`) needs to send at least 1 packet to re-establish the connection. By using the keep-alive option, we can send such a packet and the download completes successfully. --- scripts/tests/direct-download-roaming-network.sh | 5 ++--- scripts/tests/lib.sh | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/tests/direct-download-roaming-network.sh b/scripts/tests/direct-download-roaming-network.sh index 28c407d2d..880ae090b 100755 --- a/scripts/tests/direct-download-roaming-network.sh +++ b/scripts/tests/direct-download-roaming-network.sh @@ -7,9 +7,8 @@ client sh -c \ "curl \ --fail \ --max-time 12 \ - --retry 1 \ - --continue-at - \ - --limit-rate 1M \ + --keepalive-time 1 \ + --limit-rate 1000000 \ --output download.file \ http://download.httpbin/bytes?num=10000000" & diff --git a/scripts/tests/lib.sh b/scripts/tests/lib.sh index 2182303ef..e026a7790 100755 --- a/scripts/tests/lib.sh +++ b/scripts/tests/lib.sh @@ -3,19 +3,19 @@ set -euox pipefail function client() { - docker compose exec -it client "$@" + docker compose exec -T client "$@" } function gateway() { - docker compose exec -it gateway "$@" + docker compose exec -T gateway "$@" } function relay1() { - docker compose exec -it relay-1 "$@" + docker compose exec -T relay-1 "$@" } function relay2() { - docker compose exec -it relay-2 "$@" + docker compose exec -T relay-2 "$@" } function install_iptables_drop_rules() {