tests: attempt to fix disconnect-user race that caused 300 s timeouts

After the occtl disconnect, poll 'occtl show user test' until the
session is gone before attempting the reconnect.  This guarantees that
session_close() has already returned and main's event loop is free to
process the reconnect worker's AUTH_COOKIE_REQ.

Addresses intermittent failures observed in the Fedora, CentOS9, and
CentOS10 CI jobs.

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2026-06-11 15:40:37 +02:00
parent 3f4a1f0e68
commit 826fe0ff30
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -96,6 +96,14 @@ if test $? != 0;then
exit 1
fi
# Wait for main + sec-mod to finish session cleanup before reconnecting;
# without this, session_close() blocks main's event loop and the reconnect
# worker's AUTH_COOKIE_REQ goes unread, causing a deadlock.
for i in $(seq 1 10); do
${OCCTL} -s ${OCCTL_SOCKET} show user test >/dev/null 2>&1 || break
sleep 1
done
echo " * Re-connecting to obtain cookie after disconnect... "
( ${CMDNS1} ${OPENCONNECT} -q ${ADDRESS}:${PORT} -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= -s ${srcdir}/scripts/vpnc-script -C "${COOKIE}" --pid-file=${CLIPID2} -b )
if test $? = 0;then
+8
View File
@@ -91,6 +91,14 @@ if test $? != 0;then
exit 1
fi
# Wait for main + sec-mod to finish session cleanup before reconnecting;
# without this, session_close() blocks main's event loop and the reconnect
# worker's AUTH_COOKIE_REQ goes unread, causing a deadlock.
for i in $(seq 1 10); do
${OCCTL} -s ${OCCTL_SOCKET} show user test >/dev/null 2>&1 || break
sleep 1
done
echo " * Re-connecting to obtain cookie after disconnect... "
( ${CMDNS1} ${OPENCONNECT} -q ${ADDRESS}:${PORT} -u test --servercert=pin-sha256:xp3scfzy3rOQsv9NcOve/8YVVv+pHr4qNCXEXrNl5s8= -s ${srcdir}/scripts/vpnc-script -C "${COOKIE}" --pid-file=${CLIPID} -b )
if test $? = 0;then