jnthn / p6-io-socket-async-ssl

Asynchronous TLS sockets in Raku
11 stars 19 forks source link

Test suite uses Test.pm6 in a thread-unsafe way #30

Closed zoffixznet closed 6 years ago

zoffixznet commented 6 years ago

Test.pm6 is not thread safe, but briefly looking at t/client-server.t, it looks like the test routines are called from multiple threads, resulting in occasional TAP output issues (below).

One solution would probably be to setup a Channel and .send it Callables that execute test routines to execute

===> Testing: IO::Socket::Async::SSL:ver<0.6.1>
Testing with plugin: Zef::Service::Shell::prove+{<anon|94600233945632>}
t/bad-incoming.t ... ok
t/ciphers.t ........ ok
t/client-server.t .. 
All 22 subtests passed 
t/dh-ciphers.t ..... ok
t/ecdh-ciphers.t ... ok
t/encoding.t ....... ok
t/thread-stress.t .. ok

Test Summary Report
-------------------
t/client-server.t (Wstat: 0 Tests: 22 Failed: 0)
  Parse errors: Tests out of sequence.  Found (19) but expected (18)
Files=7, Tests=31, 16 wallclock secs ( 0.04 usr  0.02 sys + 20.51 cusr  1.34 csys = 21.91 CPU)
Result: FAIL
===> Testing [FAIL]: IO::Socket::Async::SSL:ver<0.6.1>
Aborting due to test failure: IO::Socket::Async::SSL:ver<0.6.1> (use --force-test to override)
  in code  at /home/zoffix/rakudo/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 374
  in method test at /home/zoffix/rakudo/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 354
  in code  at /home/zoffix/rakudo/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 523
  in sub  at /home/zoffix/rakudo/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 520
  in method install at /home/zoffix/rakudo/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 621
  in sub MAIN at /home/zoffix/rakudo/install/share/perl6/site/sources/81436475BD18D66BFD96BBCEE07CCCDC0F368879 (Zef::CLI) line 152
  in block <unit> at /home/zoffix/rakudo/install/share/perl6/site/resources/D822DF07A6D5CB602F97ED307F62A1B3B5D2C90D line 3
  in sub MAIN at /home/zoffix/rakudo/install/share/perl6/site/bin/zef line 2
  in block <unit> at /home/zoffix/rakudo/install/share/perl6/site/bin/zef line 2

zoffix@hack:~/services/sourceable$ perl6 -v
This is Rakudo version 2018.03 built on MoarVM version 2018.03
implementing Perl 6.c.
jnthn commented 6 years ago

Was far easier to just have the Promise objects returned from the start blocks have the result to assert against. Thanks for the diagnosis.