testsuite_test: reset ready in between uses

This should fix the constant intermittent failures in GH CI.
This commit is contained in:
Juliusz Sosinowicz
2025-10-07 12:44:47 +02:00
parent b3031d25ca
commit 5069d977ed
2 changed files with 10 additions and 3 deletions

View File

@@ -197,8 +197,11 @@ int testsuite_test(int argc, char** argv)
#else
simple_test(&server_args);
#endif
if (server_args.return_code != 0) return server_args.return_code;
if (server_args.return_code != 0)
return server_args.return_code;
#if !defined(NETOS)
FreeTcpReady(&ready);
InitTcpReady(&ready);
/* Echo input wolfSSL client server test */
#ifdef HAVE_STACK_SIZE
StackSizeCheck_launch(&server_args, echoserver_test, &serverThread,

View File

@@ -1535,6 +1535,7 @@ static WC_INLINE void tcp_connect(SOCKET_T* sockfd, const char* ip, word16 port,
int udp, int sctp, WOLFSSL* ssl)
{
SOCKADDR_IN_T addr;
fprintf(stderr, "connecting to %s:%d\n", ip, port);
build_addr(&addr, ip, port, udp, sctp);
if (udp) {
wolfSSL_dtls_set_peer(ssl, &addr, sizeof(addr));
@@ -1542,8 +1543,10 @@ static WC_INLINE void tcp_connect(SOCKET_T* sockfd, const char* ip, word16 port,
tcp_socket(sockfd, udp, sctp);
if (!udp) {
if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0) {
perror("connect");
err_sys_with_errno("tcp connect failed");
}
}
}
@@ -1555,7 +1558,7 @@ static WC_INLINE void udp_connect(SOCKET_T* sockfd, const char* ip, word16 port)
SOCKADDR_IN_T addr;
build_addr(&addr, ip, port, 1, 0);
if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
err_sys_with_errno("tcp connect failed");
err_sys_with_errno("udp connect failed");
}
@@ -1692,6 +1695,7 @@ static WC_INLINE void tcp_listen(SOCKET_T* sockfd, word16* port, int useAnyAddr,
}
}
#endif
fprintf(stderr, "listening on port %d\n", *port);
}