noxxi / p5-io-socket-ssl

IO::Socket::SSL Perl Module
36 stars 59 forks source link

t/nonblock.t test fails on armv6l #76

Closed kiwiroy closed 3 years ago

kiwiroy commented 5 years ago

Both the multiple write attempts tests fail for me on a single processor RaspberryPi under the following conditions. System perl (same versions) on a multi processor Pi results in successful test with and without patch.

software system perl perlbrew
perl v5.24.1 v5.26.2
Net::SSLeay 1.80 1.85
URI 1.71 1.74
$ prove -lv t/nonblock.t
t/nonblock.t .. 
1..27
ok # [server] Server Initialization
ok # [server] 1e-09
ok # [server] tcp accept
# connect in progress
ok # [client] client tcp connect
ok # [server] received plain text
# wrote 9 bytes
ok # [client] write plain text
ok # [server] upgrade to_client to IO::Socket::SSL
ok # [client] upgrade client to IO::Socket::SSL
# SSL wants a read first
# SSL wants a read first
ok # [client] connected
ok # [client] nonblocking connect with 2 attempts
ok # [server] ssl accept handshake done
# sndbuf=16384
ok # [server] received client message
# read 30000 (1 r/w attempts)
# $!=Connection reset by peer $SSL_ERROR=SSL write error (5) send=205660
# connection closed
ok # [client] syswrite
not ok # [client] multiple write attempts
ok # [client] 30000 bytes send
ok # [server] tcp accept

My current workaround is doubling the sleep time on line 336

diff --git a/t/nonblock.t b/t/nonblock.t
index ad62799..85b5cf5 100644
--- a/t/nonblock.t
+++ b/t/nonblock.t
@@ -333,7 +333,7 @@ if ( $pid == 0 ) {
        #diag($buf);
        ok( "received client message" );

-       sleep(5);
+       sleep(10);
        my $bytes_received = 10;

        # read up to 30000 bytes from client, then close the socket
noxxi commented 3 years ago

There were fixes to t/nonblock.t in 2.071. Hopefully this fixes this problem too. If not please reopen or create a new issue with the new output from prove -lv t/nonblock.t since I've added more detailed debugging output.