New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
httpclient testsuite doesn't run #689
Comments
The two tests are running in OS X 10.5 for me. I see you're on a 64bit Linux. Which distro is that? |
Also, how have you built rbx--from a clone, using rvm? |
Sorry, I should have written that. Ubuntu 10.10. % uname -a Linux ubuntu 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux It's a VMware guest running on Windows 7 as a host. With adding '@server_thread.kill if @server_thread' at teardown_server, it runs fine but it takes long time to finish. Timing issue? Sorry for an newbie question, is there some config option to change Thread scheduling in Rubinius? |
I built rbx from 1.2.1 tarball. IIRC... % wget rubinius-1.2.1-20110215.tar.gz % gzip -dc rubinius-1.2.1-20110215.tar.gz | tar xvf - % cd rubinius-1.2.1 % ./configure % rake # without 'install' % bin/rbx -v |
So, e.g. rbx -v -Ilib test/test_httpclient.rb -n test_agent_name -n test_from -n test_host_given -n test_host_header runs fine for me on OSX but just running all the specs in test_httpclient.rb takes a really long time. I'm looking at that. I'll try running on ubunto 10.10 64bit. There is no way exposed to change the Thread scheduling. |
Ahh, I see the race in teardown_server and the different timings on Linux made this show up. Would you mind trying to profile the slow code (ie use -Xprofile on an extraction of code from the tests) to help us track that down? |
Here's a -Xprofile result from 'no slow down' code. I didn't add Thread#kill. % rbx -Xprofile -v -Ilib test/test_httpclient.rb -n test_agent_name -n test_from rubinius 1.2.1 (1.8.7 release 2011-02-15) [x86_64-unknown-linux-gnu] Loaded suite test/test_httpclient Started .EE Finished in 0.213754 seconds. 1) Error: test_from(TestHTTPClient): Errno::EADDRINUSE: Address already in use - bind(2) kernel/common/errno.rb:16:in `handle' /home/nahi/ruby/rubinius-1.2.1/lib/socket.rb:1081:in `tcp_setup' /home/nahi/ruby/rubinius-1.2.1/lib/socket.rb:1118:in `initialize' /home/nahi/ruby/rubinius-1.2.1/lib/webrick/utils.rb:73:in `create_listeners' kernel/bootstrap/array.rb:71:in `each' /home/nahi/ruby/rubinius-1.2.1/lib/webrick/utils.rb:70:in `create_listeners' /home/nahi/ruby/rubinius-1.2.1/lib/webrick/server.rb:75:in `listen' /home/nahi/ruby/rubinius-1.2.1/lib/webrick/server.rb:63:in `initialize' /home/nahi/ruby/rubinius-1.2.1/lib/webrick/httpserver.rb:24:in `initialize' test/test_httpclient.rb:1260:in `setup_server' test/test_httpclient.rb:26:in `setup' kernel/bootstrap/array.rb:71:in `each' kernel/bootstrap/array.rb:71:in `each' 2) Error: test_from(TestHTTPClient): NoMethodError: undefined method `reset_all' on nil:NilClass. kernel/delta/kernel.rb:85:in `reset_all (method_missing)' test/test_httpclient.rb:1295:in `teardown_client' test/test_httpclient.rb:31:in `teardown' kernel/bootstrap/array.rb:71:in `each' kernel/bootstrap/array.rb:71:in `each' 2 tests, 2 assertions, 0 failures, 2 errors Total running time: 1.561285969s % cumulative self self total time seconds seconds calls ms/call ms/call name ------------------------------------------------------------ 7.19 0.17 0.11 1 114.52 166.43 ObjectSpace.find_object 6.34 0.10 0.10 1 100.89 100.89 Rubinius::Channel#receive_timeout 5.21 0.08 0.08 12 6.92 6.92 GC.collect_young 3.72 0.06 0.06 5355 0.01 0.01 Rubinius::VM.reset_method_cache 3.64 0.06 0.06 104 0.56 0.56 Rubinius::CodeLoader#load_compiled_file 2.14 0.95 0.03 27609 0.00 0.03 Array#each 1.96 0.12 0.03 404 0.08 0.30 Rubinius::Melbourne#string_to_ast 1.87 0.09 0.03 12537 0.00 0.01 Array#hash 1.66 0.03 0.03 1 26.39 26.39 GC.collect_mature 1.53 0.10 0.02 15454 0.00 0.01 Hash#find_entry 1.45 0.03 0.02 37420 0.00 0.00 Hash::Entry#match? 1.44 0.09 0.02 10444 0.00 0.01 Hash#[]= 1.31 0.14 0.02 3556 0.01 0.04 Rubinius.add_method 1.29 0.03 0.02 57492 0.00 0.00 Array#<< 1.13 0.02 0.02 454 0.04 0.04 IO::InternalBuffer#fill 0.96 0.03 0.02 2033 0.01 0.01 Module#_each_ancestor 0.89 0.01 0.01 2 7.12 7.12 OpenSSL::X509::Store#add_file 0.86 0.03 0.01 10344 0.00 0.00 Hash#new_entry 0.83 0.04 0.01 15616 0.00 0.00 Rubinius::Melbourne::process_transforms<89> {} 0.82 0.01 0.01 95584 0.00 0.00 Kernel#kind_of? 0.81 0.06 0.01 14665 0.00 0.00 Array::hash<885> {} 0.74 0.01 0.01 2501 0.00 0.00 FFI::Platform::POSIX.stat 0.72 0.04 0.01 3024 0.00 0.01 Rubinius::Tuple#each 0.71 0.01 0.01 121945 0.00 0.00 Rubinius::Tuple#at 0.61 0.01 0.01 18917 0.00 0.00 Module::add_ivars<741> {} 0.56 0.16 0.01 14028 0.00 0.01 Hash#[] 0.56 0.01 0.01 18660 0.00 0.00 Rubinius::Generator::BasicBlock#add_stack 0.55 0.01 0.01 22 0.40 0.40 IO#prim_write 0.54 0.01 0.01 57492 0.00 0.00 Array#set_index 0.51 0.06 0.01 6144 0.00 0.01 Rubinius::Generator::initialize<184> {} 0.47 0.02 0.01 19131 0.00 0.00 Enumerable::find_all<436> {} 0.46 0.01 0.01 5016 0.00 0.00 Array#[] 0.46 0.03 0.01 1190 0.01 0.03 Hash#each_entry 0.45 0.12 0.01 2296 0.00 0.05 Rubinius.add_defn_method 0.44 0.01 0.01 19566 0.00 0.00 Hash#key_index 0.44 0.01 0.01 16531 0.00 0.00 Type.coerce_to 0.44 0.01 0.01 78269 0.00 0.00 Kernel#equal? 0.43 0.01 0.01 73139 0.00 0.00 Rubinius::Tuple#[] 0.43 0.02 0.01 2753 0.00 0.01 Array#initialize 0.41 0.05 0.01 42992 0.00 0.00 Class#allocate 0.41 0.06 0.01 9944 0.00 0.01 Hash#default 0.40 0.01 0.01 8 0.80 0.80 Socket::Foreign._getaddrinfo 0.39 0.38 0.01 392 0.02 0.98 Module#module_eval 0.39 0.01 0.01 3938 0.00 0.00 Rubinius::Tuple#dup 0.38 0.01 0.01 2455 0.00 0.00 String#[] 2,837 methods omitted 2,882 methods called a total of 1,947,549 times 1% |
Is this issue closed? I'm misunderstanding github Issues system though... |
I'll reopen the ticket. Each time I commented on it, you closed it in your next comment. :P |
Oops. Sorry for that. I should have hit 'Comment & Close'... |
Was trying this out, since this is such an old ticket, and here's what I get now:
Still works on 1.9.2p290. |
1.2.4 and 2.0.0dev (of now) works for me.
But when I run whole test like 'rbx -Ilib test/test_httpclient.rb -v', it gets stuck.
|
I've rerun this and I see no longer any hangs in httpclient specs. I do see quite a few failures but all but one seem to be due to hash order dependent tests. |
Thanks! I'll try it today. Yes, the test suite of httpclient contains a Hash order bug (on CRuby 1.8). That's exactly my fault. |
Yey, it works. http://travis-ci.org/#!/nahi/httpclient/jobs/404618 Thanks @dbussink for letting me know this! Thanks Rubinius team for making it work! Closing this issue finally. |
I should say 'httpclient does not run on rbx' at this moment. - rubinius/rubinius#689 - http://travis-ci.org/#!/nahi/httpclient/builds/85213
httpclient testsuite uses HTTPClient as a socket client and WEBrick as a socket server. Single testcase runs fine but if I try run 2 or more testcases, it fails.
It looks that WEBrick server doesn't terminated properly at teardown.
https://github.com/nahi/httpclient/blob/master/test/test_httpclient.rb#L1287
Steps to reproduce:
P.S. It runs fine on CRuby and JRuby.
The text was updated successfully, but these errors were encountered: