randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.6k stars 570 forks source link

test_tls_stream_integration sometimes timeout #4360

Open omnivagant opened 1 month ago

omnivagant commented 1 month ago

In AlpineLinux we noticed that parts of this test would sometimes timeout on some architectures, most often loongarch64 and riscv64:

tls_stream_integration:
Server ran 44 tests 3 FAILED
Failure 1: Server: timeout in accept
Failure 2: Server: timeout in accept
Failure 3: Server: timeout in accept

Raising this timeout helps:

--- a/src/tests/test_tls_stream_integration.cpp
+++ b/src/tests/test_tls_stream_integration.cpp
@@ -33,7 +33,7 @@ using ssl_stream = Botan::TLS::Stream<ne
 using namespace std::placeholders;
 using Result = Botan_Tests::Test::Result;

-static const auto k_timeout = std::chrono::seconds(3);
+static const auto k_timeout = std::chrono::seconds(6);
 static const auto k_endpoints = std::vector<tcp::endpoint> {tcp::endpoint{net::ip::make_address("127.0.0.1"), 8082}};

 enum { max_msg_length = 512 };
reneme commented 1 month ago

I'm assuming you are using Botan 2.x, right? During the development of TLS 1.3 in Botan 3.x we raised this timeout (and improved the steering of this test case), because we saw a similar flaky behavior in our CI.

@randombit Should we backport this, perhaps?