[PATCH] Tests: adjusted delays in ssl_session_ticket_key.t
Maxim Dounin
mdounin at mdounin.ru
Mon Sep 1 08:27:25 UTC 2025
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1756715195 -10800
# Mon Sep 01 11:26:35 2025 +0300
# Node ID 468102e2a704618f2829e68d340b6feffab609aa
# Parent 25acbb7405e84b60b13f3894768d6fa778149ac7
Tests: adjusted delays in ssl_session_ticket_key.t.
If session ticket keys are not shared among worker processes, waiting
for 0.5 seconds before trying to establish another session won't change
anything (if the connection will end up in the different worker process,
there will be an error).
At the same time, the test was seen unexpectedly failing with Valgrind,
due to slow connection handling. Since session ticket key rotation uses
time in seconds, slightly more than 1 second between requests is enough
for the test to fail if the first request happens at the end of a second.
Removing the unneeded sleep improves things, but not enough to fully
resolve the issue. As such, session timeout was set to 3 seconds.
Wait time between tests adjusted accordingly, to slightly more than 4
seconds, to ensure that the key will be changed even if the first request
happens at the start of a second.
diff --git a/ssl_session_ticket_key.t b/ssl_session_ticket_key.t
--- a/ssl_session_ticket_key.t
+++ b/ssl_session_ticket_key.t
@@ -52,7 +52,7 @@ http {
server_name localhost;
ssl_session_cache shared:SSL:1m;
- ssl_session_timeout 2;
+ ssl_session_timeout 3;
}
}
@@ -92,10 +92,9 @@ foreach my $name ('localhost') {
my $key = get_ticket_key_name();
-select undef, undef, undef, 0.5;
is(get_ticket_key_name(), $key, 'ticket key match');
-select undef, undef, undef, 2.5;
+select undef, undef, undef, 4.1;
local $TODO = 'no ticket key callback'
if $t->has_module('OpenSSL') and not $t->has_feature('openssl:0.9.8h');
More information about the nginx-devel
mailing list