p6-HTTP-Server-Tiny icon indicating copy to clipboard operation
p6-HTTP-Server-Tiny copied to clipboard

# Failed test at t/06-channel.t line 35

Open niner opened this issue 9 years ago • 17 comments

t/06-channel.t is failing here after hanging for a minute with 200 % CPU usage.

This is Rakudo version 2016.10-307-gbca0ae5 built on MoarVM version 2016.10-71-g9d5c874 implementing Perl 6.c.

It's a clean, fresh rakudo install with just panda bootstrapped and panda install HTTP::Server::Tiny

p6-HTTP-Server-Tiny (master=)> perl6 -Ilib t/06-channel.t 
1..1
http server is ready: http://127.0.0.1:15555/ (pid:12325, keepalive: 1)
not ok 1 - 

# Failed test at t/06-channel.t line 35
# expected: '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100'
#      got: (Failure)
# Looks like you failed 1 test of 1

niner avatar Nov 20 '16 11:11 niner

eugh

jonathanstowe avatar Nov 20 '16 15:11 jonathanstowe

Okay, that's plain weird as it doesn't do that for me with a 2016.11-5-ge9487d6 is it possibly that a tiny bug passed through rakudo or moar and got fixed?

jonathanstowe avatar Nov 20 '16 15:11 jonathanstowe

Tried it even on a different system and now with Rakudo version 2016.11-7-g939d273 and used zef instead of panda, but still get the same error.

niner avatar Nov 21 '16 21:11 niner

[jonathan@coriolanus p6-HTTP-Server-Tiny]$ perl6 -v
This is Rakudo version 2016.11-5-ge9487d6 built on MoarVM version 2016.11
implementing Perl 6.c.
[jonathan@coriolanus p6-HTTP-Server-Tiny]$ panda-test
t/02-server.t ........... ok
t/04-get.t .............. ok
t/05-post.t ............. ok
t/06-channel.t .......... ok
t/07-io-handle.t ........ ok
t/08-long-req.t ......... ok
t/09-chunked-request.t .. ok
t/10-ise.t .............. ok
t/11-str.t .............. ok
t/12-supply.t ........... ok
t/13-promise.t .......... ok
All tests successful.
Files=11, Tests=14, 27 wallclock secs ( 0.09 usr  0.01 sys + 23.17 cusr  2.04 csys = 25.31 CPU)
Result: PASS

Like I say, weird.

jonathanstowe avatar Nov 21 '16 21:11 jonathanstowe

This block Crust from installing as well.

This is Rakudo version 2016.11 built on MoarVM version 2016.11 implementing Perl 6.c.

Failed test at t/06-channel.t line 35

expected: '1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575

85960616263646566676869707172737475767778798081828384858687888990919293949596979899100'

got: (Failure)

Looks like you failed 1 test of 1

t/06-channel.t .......... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests

adaptiveoptics avatar Dec 06 '16 02:12 adaptiveoptics

Interestingly -- this fails during a panda or zef install when brought in as a dependency of Crust. However, after it failed, I was able to install it just as itself without error. Then Crust would install ok.

Also, over several days I watched it, HTTP::Server::Tiny was causing Travis builds to fail for a module depending on Crust, until I told the Travis build not to run any tests on dependencies.

adaptiveoptics avatar Dec 06 '16 03:12 adaptiveoptics

Unfoirtunately this is one of those things where unless it can be reproduced reliably or someone has a flash of insight it's going to be difficult to fix.

jonathanstowe avatar Dec 06 '16 07:12 jonathanstowe

It appears the module itself works just fine, so I'm guessing just the one test is problematic. Could we get that one test commented out, so that other packages depending on this in some way, can be installed?

adaptiveoptics avatar Dec 06 '16 07:12 adaptiveoptics

Yeah I am pretty sure it is the just test, I think it is just a timing issue. It would almost certainly be better to leave the test but marked as TODO while someone works out how to do it properly, what is being tested there needs to be tested after all :)

jonathanstowe avatar Dec 06 '16 09:12 jonathanstowe

Can someone else try with that version of the test? I think that may remove the timing issue.

jonathanstowe avatar Dec 06 '16 10:12 jonathanstowe

Well, I see somebody decided to take advantage of Travis, and this time it compiled without an error! I'll go ahead and change dependencies in the Crust Session DBIish store module, and Travis will go ahead and build all of Rakudo/Perl, build all of Crust and its dependencies... just to test about 40 lines of code ;) But it will most certainly tell us if this build is failing any more in a long-ish process.

adaptiveoptics avatar Dec 06 '16 22:12 adaptiveoptics

ok! well, the full test build on travis for crust completes now! and it looks like crust can be installed again too without erroring out. thank you so much Jonathan!

adaptiveoptics avatar Dec 06 '16 23:12 adaptiveoptics

While running on:

# perl6 -v
This is Rakudo version 2017.01 built on MoarVM version 2017.01
implementing Perl 6.c.

I got this:

 zef install HTTP::Server::Tiny
===> Searching for: HTTP::Server::Tiny
===> Testing: HTTP::Server::Tiny
t/02-server.t ........... ok
t/04-get.t .............. ok
t/05-post.t ............. ok

# Failed test at t/06-channel.t line 37
# expected: '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100'
#      got: ''
# Looks like you failed 1 test of 1
t/06-channel.t .......... Failed 1/1 subtests
t/07-io-handle.t ........ ok
t/08-long-req.t ......... ok
t/09-chunked-request.t .. ok
t/10-ise.t .............. ok
t/11-str.t .............. ok
t/12-supply.t ........... ok
t/13-promise.t .......... ok

Test Summary Report
-------------------
t/06-channel.t  (Wstat: 0 Tests: 1 Failed: 1)
  Failed tests:  1
Files=11, Tests=14,  75 wallclock secs
Result: FAILED
===> Testing [FAIL]: HTTP::Server::Tiny
Aborting due to test failure: HTTP::Server::Tiny (use --force to override)
  in code  at /usr/share/perl6/site/sources/1DC0BAA246D0774E7EB4F5119C6168E0D8266EFA (Zef::Client) line 306
  in method test at /usr/share/perl6/site/sources/1DC0BAA246D0774E7EB4F5119C6168E0D8266EFA (Zef::Client) line 285
  in code  at /usr/share/perl6/site/sources/1DC0BAA246D0774E7EB4F5119C6168E0D8266EFA (Zef::Client) line 457
  in sub  at /usr/share/perl6/site/sources/1DC0BAA246D0774E7EB4F5119C6168E0D8266EFA (Zef::Client) line 454
  in method install at /usr/share/perl6/site/sources/1DC0BAA246D0774E7EB4F5119C6168E0D8266EFA (Zef::Client) line 560
  in sub MAIN at /usr/share/perl6/site/sources/A9948E7371E0EB9AFDF1EEEB07B52A1B75537C31 (Zef::CLI) line 123
  in block <unit> at /usr/share/perl6/site/resources/3DD33EF601FD300095284AE7C24B770BAADAF32E line 1

szabgab avatar Apr 05 '17 18:04 szabgab

Hi, Is there any chance of trying this with a newer rakudo as I can't replicate with 2017.03-43-g4fdebc9 that I have here.

jonathanstowe avatar Apr 05 '17 19:04 jonathanstowe

Right now on Rakudo version 2017.03-141-gad01ed7 built on MoarVM version 2017.03-95-g7beffd3 it seems even worse. Running tests with for F in t/*.t ; do echo $F; perl6 -Ilib $F ; done everything looks fine, except for:

t/10-ise.t
1..1
http server is ready: http://127.0.0.1:15555/ (pid:20957, keepalive: 1)
[ERROR] [20957] [4] Died   in sub  at t/10-ise.t line 16
  in sub  at /home/nine/install/p6-HTTP-Server-Tiny/lib/HTTP/Server/Tiny.pm6 (HTTP::Server::Tiny) line 254
  [...]

ok 1 -

But when running with prove -e 'perl6 -Ilib' there are failures all over the place, including the one reported in this issue:

t/02-server.t ........... ok                                            
===(       2;0  0/1  0/1  1/1  0/? )====================================
# Failed test at t/06-channel.t line 37
# expected: '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100'
#      got: (Failure)
# Looks like you failed 1 test of 1
t/06-channel.t .......... Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/1 subtests 
===(       2;0  0/1  0/1  0/? )=========================================Failed
  in block  at t/04-get.t line 34
  in sub from-json at /home/nine/rakudo/install/share/perl6/site/sources/11ED005DCC03AA42CAA87A439556DB9B6B2C9E59 (JSON::Fast) line 286
  in block <unit> at t/04-get.t line 35

t/04-get.t .............. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests 
===(       3;0  1/1  0/?  0/?  0/? )====================================
# Failed test at t/05-post.t line 29
# expected: 'foo=bar'
#      got: (Failure)
# Looks like you failed 1 test of 1
t/05-post.t ............. Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/1 subtests 
===(       3;0  0/?  0/?  0/? )=========================================Use of Nil in numeric context
  in block <unit> at t/09-chunked-request.t line 76
===(       4;1  0/1  0/1  1/1  0/1 )====================================
# Failed test at t/09-chunked-request.t line 76
# Looks like you failed 1 test of 1
t/09-chunked-request.t .. Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/1 subtests 
t/07-io-handle.t ........ ok                                            
===(       6;1  0/1  1/1  0/?  0/? )====================================
# Failed test at t/10-ise.t line 23
# expected: 'Internal Server Error!'
#      got: (Failure)
# Looks like you failed 1 test of 1
t/10-ise.t .............. Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/1 subtests 
===(       7;1  1/1  0/?  0/?  0/? )====================================
# Failed test at t/08-long-req.t line 37
# expected: 'hello
# hello
# hello
[...]
# hello
# hello
# '
#      got: 'use v6;
# # HELLO

# use Test;
# use lib 't/lib';
# use Test::TCP;

# use HTTP::Server::Tiny;
# use HTTP::Tinyish;

# plan 1;

# my $port = 15555;

# my $server = HTTP::Server::Tiny.new(host => '127.0.0.1', port => $port);

# Thread.start({
#     $server.run(sub ($env) {
#         my $fh = open 't/07-io-handle.t', :r;
#         return 200, ['Content-Type' => 'text/plain'], $fh
#     });
# }, :app_lifetime);

# wait_port($port);
# my $resp = HTTP::Tinyish.new.post("http://127.0.0.1:$port/",
#    headers => { 
#         'content-type' => 'application/x-www-form-urlencoded'
#     },
#     content => 'foo=bar');
# ok $resp<content> ~~ /HELLO/;

# '
# Looks like you failed 1 test of 1
t/08-long-req.t ......... Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/1 subtests 
t/11-str.t .............. ok                                            
===(       9;1  0/1  0/? )==============================================Type Slip does not support associative indexing.
  in sub MAIN at t/bin/test-client line 12
  in block <unit> at t/bin/test-client line 5

Actually thrown at:
  in sub MAIN at t/bin/test-client line 12
  in block <unit> at t/bin/test-client line 5

===(      10;1  1/1  0/? )==============================================
# Failed test at t/12-supply.t line 27
# expected: '123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100'
#      got: ''
# Looks like you failed 1 test of 1
t/12-supply.t ........... Dubious, test returned 1 (wstat 256, 0x100)   
Failed 1/1 subtests 
t/13-promise.t .......... ok   

Test Summary Report
-------------------
t/06-channel.t        (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/04-get.t            (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
t/05-post.t           (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/09-chunked-request.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/10-ise.t            (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/08-long-req.t       (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/12-supply.t         (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=11, Tests=13,  6 wallclock secs ( 0.04 usr  0.01 sys +  7.80 cusr  0.58 csys =  8.43 CPU)
Result: FAIL

niner avatar Apr 06 '17 06:04 niner

@niner I think that it is somehow getting the test's source code in the t/08-long-req.t (which was never failing before ) would suggest that there has been some somewhat incompatible change in rakudo.

jonathanstowe avatar Apr 06 '17 08:04 jonathanstowe

Literally compiled from the rakudo of five minutes ago:

jns:~/devel/p6-HTTP-Server-Tiny$ prove -e 'perl6 -Ilib'
t/02-server.t ........... ok   
t/04-get.t .............. ok   
t/05-post.t ............. ok   
t/06-channel.t .......... ok   
t/07-io-handle.t ........ ok   
t/08-long-req.t ......... ok   
t/09-chunked-request.t .. ok   
t/10-ise.t .............. ok   
t/11-str.t .............. ok   
t/12-supply.t ........... ok   
t/13-promise.t .......... ok   
All tests successful.
Files=11, Tests=14, 10 wallclock secs ( 0.04 usr  0.01 sys +  6.54 cusr  0.73 csys =  7.32 CPU)
Result: PASS
jns:~/devel/p6-HTTP-Server-Tiny$ perl6 -v
This is Rakudo version 2017.03-143-g5704e5f built on MoarVM version 2017.03-87-g5d73bf4
implementing Perl 6.c.

jonathanstowe avatar Apr 06 '17 09:04 jonathanstowe