igrigorik / em-http-request

Asynchronous HTTP Client (EventMachine + Ruby)
1.22k stars 220 forks source link

Failing tests #318

Closed jackorp closed 6 years ago

jackorp commented 6 years ago

When testing with rspec and using WEBrick instead of Mongrel in tests (since Mongrel is not supported) I got following errors, rspec output:

$ rspec spec
[2018-05-25 16:13:36] INFO  WEBrick 1.4.2
[2018-05-25 16:13:36] INFO  ruby 2.5.1 (2018-03-29) [x86_64-linux]
[2018-05-25 16:13:36] INFO  WEBrick::HTTPServer#start: pid=1246 port=8090
.................................127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "HEAD / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "PUT / HTTP/1.1" 200 4
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "POST / HTTP/1.1" 200 4
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /authtest HTTP/1.1" 200 7
- -> /authtest
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /auth HTTP/1.1" 200 90
- -> /auth
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "GET /fail HTTP/1.1" 404 0
- -> /fail
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /deflate HTTP/1.1" 200 12
- -> /deflate
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo_query HTTP/1.1" 200 0
- -> /echo_query
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "DELETE / HTTP/1.1" 200 0
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip-large HTTP/1.1" 200 16344
- -> /gzip-large
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "GET /fail HTTP/1.1" 404 0
- -> /fail
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "GET /echo_query?hash[]=value1&hash[]=value2 HTTP/1.1" 200 27
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST / HTTP/1.1" 200 26
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /auth HTTP/1.1" 200 73
- -> /auth
- -> /
127.0.0.1 - - [25/May/2018:16:13:37 CEST] "GET / HTTP/1.1" 200 13
- -> /
- -> /
- -> /echo_query?hash[]=value1&hash[]=value2
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /authtest HTTP/1.1" 200 7
- -> /authtest
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo_headers HTTP/1.1" 200 0
- -> /echo_headers
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /relative-location HTTP/1.1" 301 0
- -> /relative-location
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /deflate HTTP/1.1" 200 12
- -> /deflate
..127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /set_cookie HTTP/1.1" 200 10
- -> /set_cookie
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /set_multiple_cookies HTTP/1.1" 200 11
- -> /set_multiple_cookies
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo_cookie HTTP/1.1" 200 5
- -> /echo_cookie
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo_cookie HTTP/1.1" 200 5
.- -> /echo_cookie
..127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST / HTTP/1.1" 200 509
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
....127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST /echo_content_type HTTP/1.1" 200 0
- -> /echo_content_type
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST /echo_content_type HTTP/1.1" 200 33
.- -> /echo_content_type
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST /echo_content_type HTTP/1.1" 200 19
.- -> /echo_content_type
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST /echo_content_type HTTP/1.1" 200 28
- -> /echo_content_type
..127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST /echo_content_type HTTP/1.1" 200 31
- -> /echo_content_type
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
..127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
...127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo-user-agent HTTP/1.1" 200 25
- -> /echo-user-agent
..127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo-user-agent HTTP/1.1" 200 2
- -> /echo-user-agent
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo-user-agent HTTP/1.1" 200 3
- -> /echo-user-agent
...[2018-05-25 16:13:38] ERROR URI::InvalidURIError: bad URI(is not URI?): http://$$$@$!%&^
    /usr/share/ruby/uri/rfc3986_parser.rb:67:in `split'
    /usr/share/ruby/uri/rfc3986_parser.rb:73:in `parse'
    /usr/share/ruby/uri/rfc3986_parser.rb:117:in `convert_to_uri'
    /usr/share/ruby/uri/generic.rb:1101:in `merge'
    /usr/share/ruby/webrick/httpresponse.rb:279:in `setup_header'
    /usr/share/gems/gems/rack-2.0.4/lib/rack/handler/webrick.rb:16:in `setup_header'
    /usr/share/ruby/webrick/httpresponse.rb:209:in `send_response'
    /usr/share/ruby/webrick/httpserver.rb:112:in `run'
    /usr/share/ruby/webrick/server.rb:307:in `block in start_thread'
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/badhost HTTP/1.1" 301 0
- -> /redirect/badhost
F..............127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /proxyauth?q=test HTTP/1.1" 200 4
- -> /proxyauth?q=test
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /echo_authorization_header HTTP/1.1" 200 32
- -> /echo_authorization_header
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
....127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
..127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
.- -> /
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST / HTTP/1.1" 200 15
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "HEAD / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "DELETE / HTTP/1.1" 200 0
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST / HTTP/1.1" 200 0
- -> /
- -> /
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "PUT / HTTP/1.1" 200 0
- -> /
.....127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "POST / HTTP/1.1" 200 0
- -> /
....127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/created HTTP/1.1" 201 13
- -> /redirect/created
...127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "HEAD /redirect/head HTTP/1.1" 301 0
- -> /redirect/head
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "HEAD / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
.- -> /
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
.- -> /redirect
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/bad HTTP/1.1" 301 0
- -> /redirect/bad
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/nohost HTTP/1.1" 301 0
- -> /redirect/nohost
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/timeout HTTP/1.1" 301 0
- -> /redirect/timeout
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/multiple-with-cookie HTTP/1.1" 301 8
- -> /redirect/multiple-with-cookie
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/multiple-with-cookie HTTP/1.1" 301 8
- -> /redirect/multiple-with-cookie
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/middleware_redirects_1 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_1
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/middleware_redirects_2 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_2
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/middleware_redirects_3 HTTP/1.1" 200 0
- -> /redirect/middleware_redirects_3
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/middleware_redirects_1 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_1
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/middleware_redirects_2 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_2
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/http_no_port HTTP/1.1" 301 0
- -> /redirect/http_no_port
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/https_no_port HTTP/1.1" 301 0
- -> /redirect/https_no_port
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/http_with_port HTTP/1.1" 301 0
- -> /redirect/http_with_port
F127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/https_with_port HTTP/1.1" 301 0
- -> /redirect/https_with_port
F127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/ignore_query_option?ignore=1 HTTP/1.1" 301 0
- -> /redirect/ignore_query_option?ignore=1
.127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /redirect/url HTTP/1.1" 200 34
- -> /redirect/url
..

Failures:

  1) EventMachine::HttpRequest should fail gracefully on an invalid host in Location header
     Failure/Error: http.error.should match('unable to resolve server address')
       expected "connection closed by server" to match "unable to resolve server address"
     # ./spec/dns_spec.rb:10:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/client.rb:117:in `unbind'
     # ./lib/em-http/http_connection.rb:205:in `block in unbind'
     # ./lib/em-http/http_connection.rb:205:in `map'
     # ./lib/em-http/http_connection.rb:205:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:1482:in `event_callback'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/dns_spec.rb:6:in `block (2 levels) in <top (required)>'

  2) EventMachine::HttpRequest should keep default http port in redirect url that include it
     Failure/Error: http.last_effective_url.to_s.should == 'http://host:80/'

       expected: "http://host:80/"
            got: "http://host/" (using ==)
     # ./spec/redirect_spec.rb:348:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:226:in `rescue in unbind'
     # ./lib/em-http/http_connection.rb:213:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:1482:in `event_callback'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/redirect_spec.rb:344:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # EventMachine::ConnectionError:
     #   unable to resolve address: Name or service not known
     #   /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:795:in `connect_server'

  3) EventMachine::HttpRequest should keep default https port in redirect url that include it
     Failure/Error: http.last_effective_url.to_s.should == 'https://host:443/'

       expected: "https://host:443/"
            got: "https://host/" (using ==)
     # ./spec/redirect_spec.rb:359:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:226:in `rescue in unbind'
     # ./lib/em-http/http_connection.rb:213:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:1482:in `event_callback'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/redirect_spec.rb:355:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # EventMachine::ConnectionError:
     #   unable to resolve address: Name or service not known
     #   /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:795:in `connect_server'

Finished in 0.78788 seconds (files took 1.32 seconds to load)
126 examples, 3 failures

Failed examples:

rspec ./spec/dns_spec.rb:5 # EventMachine::HttpRequest should fail gracefully on an invalid host in Location header
rspec ./spec/redirect_spec.rb:343 # EventMachine::HttpRequest should keep default http port in redirect url that include it
rspec ./spec/redirect_spec.rb:354 # EventMachine::HttpRequest should keep default https port in redirect url that include it

127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /timeout HTTP/1.1" 200 0
127.0.0.1 - - [25/May/2018:16:13:38 CEST] "GET /timeout HTTP/1.1" 200 0
- -> /timeout
[2018-05-25 16:13:38] INFO  going to shutdown ...
- -> /timeout
[2018-05-25 16:13:43] INFO  WEBrick::HTTPServer#start done.

ruby version:

$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]

list of gems:

$ gem list

*** LOCAL GEMS ***

addressable (2.5.2)
cmath (default: 1.0.0)
cookiejar (0.3.2)
csv (default: 1.0.0)
date (default: 1.0.0)
dbm (default: 1.0.0)
diff-lcs (1.3)
em-socksify (0.3.0)
etc (default: 1.0.0)
eventmachine (1.2.6)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
gdbm (default: 2.0.0)
http_parser.rb (0.6.0)
io-console (0.4.6)
ipaddr (default: 1.2.0)
json (2.1.0)
multi_json (1.13.1)
openssl (2.1.0)
psych (3.0.2)
public_suffix (3.0.1)
rack (2.0.4)
rake (12.3.1)
rdoc (6.0.3)
rspec (3.7.0)
rspec-core (3.7.1)
rspec-expectations (3.7.0)
rspec-mocks (3.7.0)
rspec-support (3.7.1)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
webrick (default: 1.4.2)
zlib (default: 1.0.0)
michielboekhoff commented 6 years ago

Hi there.

I'm getting a similar experience. I'm building the master branch, and I'm getting more errors:

[2018-05-30 16:22:32] INFO  WEBrick 1.3.1
[2018-05-30 16:22:32] INFO  ruby 2.4.1 (2017-03-22) [x86_64-darwin17]
[2018-05-30 16:22:32] INFO  WEBrick::HTTPServer#start: pid=97034 port=8090
..................F..........................127.0.0.1 - - [30/May/2018:16:22:33 BST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:33 BST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:33 BST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:33 BST] "HEAD / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [30/May/2018:16:22:33 BST] "DELETE / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [30/May/2018:16:22:33 BST] "GET /timeout HTTP/1.1" 200 0
- -> /timeout
F...127.0.0.1 - - [30/May/2018:16:22:43 BST] "POST /echo_content_type HTTP/1.1" 200 0
- -> /echo_content_type
..127.0.0.1 - - [30/May/2018:16:22:43 BST] "POST /echo_content_type HTTP/1.1" 200 33
- -> /echo_content_type
.127.0.0.1 - - [30/May/2018:16:22:43 BST] "POST /echo_content_type HTTP/1.1" 200 19
- -> /echo_content_type
127.0.0.1 - - [30/May/2018:16:22:43 BST] "POST /echo_content_type HTTP/1.1" 200 28
.- -> /echo_content_type
127.0.0.1 - - [30/May/2018:16:22:43 BST] "POST /echo_content_type HTTP/1.1" 200 31
- -> /echo_content_type
.127.0.0.1 - - [30/May/2018:16:22:43 BST] "GET / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [30/May/2018:16:22:43 BST] "GET / HTTP/1.1" 200 13
- -> /
....127.0.0.1 - - [30/May/2018:16:22:43 BST] "GET /echo-user-agent HTTP/1.1" 200 25
- -> /echo-user-agent
.127.0.0.1 - - [30/May/2018:16:22:43 BST] "GET /echo-user-agent HTTP/1.1" 200 2
- -> /echo-user-agent
.127.0.0.1 - - [30/May/2018:16:22:43 BST] "GET /echo-user-agent HTTP/1.1" 200 3
- -> /echo-user-agent
....[2018-05-30 16:22:43] ERROR URI::InvalidURIError: bad URI(is not URI?): http://$$$@$!%&^
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/uri/rfc3986_parser.rb:67:in `split'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/uri/rfc3986_parser.rb:73:in `parse'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/uri/rfc3986_parser.rb:117:in `convert_to_uri'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/uri/generic.rb:1099:in `merge'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpresponse.rb:277:in `setup_header'
    /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/rack-2.0.5/lib/rack/handler/webrick.rb:16:in `setup_header'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpresponse.rb:207:in `send_response'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:112:in `run'
    /Users/mboekhoff/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'
127.0.0.1 - - [30/May/2018:16:22:43 BST] "GET /redirect/badhost HTTP/1.1" 301 0
- -> /redirect/badhost
F..........127.0.0.1 - - [30/May/2018:16:22:33 BST] "GET /fail HTTP/1.1" 404 0
- -> /fail
...F.........127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /proxyauth?q=test HTTP/1.1" 200 4
- -> /proxyauth?q=test
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /echo_authorization_header HTTP/1.1" 200 32
- -> /echo_authorization_header
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.**127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.............................127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [30/May/2018:16:22:50 BST] "GET / HTTP/1.1" 200 13
- -> /
..127.0.0.1 - - [30/May/2018:16:22:50 BST] "POST / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:50 BST] "POST / HTTP/1.1" 200 15
- -> /
.127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET / HTTP/1.1" 200 13
127.0.0.1 - - [30/May/2018:16:22:51 BST] "POST / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [30/May/2018:16:22:51 BST] "HEAD / HTTP/1.1" 200 0
- -> /
- -> /
127.0.0.1 - - [30/May/2018:16:22:51 BST] "DELETE / HTTP/1.1" 200 0
127.0.0.1 - - [30/May/2018:16:22:51 BST] "PUT / HTTP/1.1" 200 0
- -> /
.- -> /
....127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:51 BST] "POST / HTTP/1.1" 200 0
.- -> /
..127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET / HTTP/1.1" 200 13
.- -> /
127.0.0.1 - - [30/May/2018:16:22:33 BST] "GET /fail HTTP/1.1" 404 0
- -> /fail
..127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect/created HTTP/1.1" 201 13
- -> /redirect/created
....127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.127.0.0.1 - - [30/May/2018:16:22:51 BST] "HEAD /redirect/head HTTP/1.1" 301 0
- -> /redirect/head
127.0.0.1 - - [30/May/2018:16:22:51 BST] "HEAD / HTTP/1.1" 200 0
- -> /
..127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
..127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect/bad HTTP/1.1" 301 0
- -> /redirect/bad
.127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect/nohost HTTP/1.1" 301 0
- -> /redirect/nohost
.127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /redirect/timeout HTTP/1.1" 301 0
- -> /redirect/timeout
.127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/multiple-with-cookie HTTP/1.1" 301 8
- -> /redirect/multiple-with-cookie
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/multiple-with-cookie HTTP/1.1" 301 8
- -> /redirect/multiple-with-cookie
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/middleware_redirects_1 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_1
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/middleware_redirects_2 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_2
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/middleware_redirects_3 HTTP/1.1" 200 0
.- -> /redirect/middleware_redirects_3
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/middleware_redirects_1 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_1
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/middleware_redirects_2 HTTP/1.1" 301 0
.- -> /redirect/middleware_redirects_2
127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/http_no_port HTTP/1.1" 301 0
- -> /redirect/http_no_port
.127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/https_no_port HTTP/1.1" 301 0
- -> /redirect/https_no_port
.127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/http_with_port HTTP/1.1" 301 0
- -> /redirect/http_with_port
F127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/https_with_port HTTP/1.1" 301 0
- -> /redirect/https_with_port
F127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/ignore_query_option?ignore=1 HTTP/1.1" 301 0
- -> /redirect/ignore_query_option?ignore=1
.127.0.0.1 - - [30/May/2018:16:22:52 BST] "GET /redirect/url HTTP/1.1" 200 34
- -> /redirect/url
...

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) EventMachine::HttpRequest connections via when parsing *_PROXY var (through proxy)s with $HTTPS_PROXY env should use HTTP proxy
     # Mongrel isn't configured to handle HTTPS, currently
     # ./spec/http_proxy_spec.rb:4

  2) EventMachine::HttpRequest connections via when parsing *_PROXY var (through proxy)s with $https_proxy env should use HTTP proxy
     # Mongrel isn't configured to handle HTTPS, currently
     # ./spec/http_proxy_spec.rb:4

Failures:

  1) EventMachine::HttpRequest should set content-length to 0 on posts with empty bodies
     Failure/Error: http.response.strip.split(':')[1].should == '0'

       expected: "0"
            got: nil (using ==)
     # ./spec/client_spec.rb:239:in `block (4 levels) in <top (required)>'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:151:in `set_deferred_status'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:191:in `succeed'
     # ./lib/em-http/client.rb:113:in `unbind'
     # ./lib/em-http/client.rb:71:in `on_request_complete'
     # ./lib/em-http/http_connection.rb:137:in `block in post_init'
     # ./lib/em-http/http_connection.rb:152:in `<<'
     # ./lib/em-http/http_connection.rb:152:in `receive_data'
     # ./lib/em-http/http_connection.rb:23:in `receive_data'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
     # ./spec/client_spec.rb:232:in `block (2 levels) in <top (required)>'

  2) EventMachine::HttpRequest should report error if connection was closed by server on client keepalive requests
     Failure/Error: req.error.should match('connection closed by server')

       expected Errno::ETIMEDOUT to match "connection closed by server"
       Diff:
       @@ -1,2 +1,2 @@
       -"connection closed by server"
       +Errno::ETIMEDOUT

     # ./spec/client_spec.rb:822:in `block (5 levels) in <top (required)>'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/client.rb:117:in `unbind'
     # ./lib/em-http/http_connection.rb:205:in `block in unbind'
     # ./lib/em-http/http_connection.rb:205:in `map'
     # ./lib/em-http/http_connection.rb:205:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:1482:in `event_callback'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
     # ./spec/client_spec.rb:813:in `block (2 levels) in <top (required)>'

  3) EventMachine::HttpRequest should fail gracefully on an invalid host in Location header
     Failure/Error: http.error.should match(/unable to resolve (server |)address/)

       expected "connection closed by server" to match /unable to resolve (server |)address/
       Diff:
       @@ -1,2 +1,2 @@
       -/unable to resolve (server |)address/
       +"connection closed by server"

     # ./spec/dns_spec.rb:10:in `block (4 levels) in <top (required)>'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/client.rb:117:in `unbind'
     # ./lib/em-http/http_connection.rb:205:in `block in unbind'
     # ./lib/em-http/http_connection.rb:205:in `map'
     # ./lib/em-http/http_connection.rb:205:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:1482:in `event_callback'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
     # ./spec/dns_spec.rb:6:in `block (2 levels) in <top (required)>'

  4) EventMachine::HttpRequest should detect deflate encoding
     Failure/Error: http.response_header["CONTENT_ENCODING"].should == "deflate"

       expected: "deflate"
            got: nil (using ==)
     # ./spec/external_spec.rb:92:in `block (5 levels) in <top (required)>'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:151:in `set_deferred_status'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:191:in `succeed'
     # ./lib/em-http/client.rb:113:in `unbind'
     # ./lib/em-http/client.rb:71:in `on_request_complete'
     # ./lib/em-http/http_connection.rb:137:in `block in post_init'
     # ./lib/em-http/http_connection.rb:152:in `<<'
     # ./lib/em-http/http_connection.rb:152:in `receive_data'
     # ./lib/em-http/http_connection.rb:23:in `receive_data'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
     # ./spec/external_spec.rb:84:in `block (3 levels) in <top (required)>'

  5) EventMachine::HttpRequest should keep default http port in redirect url that include it
     Failure/Error: http.last_effective_url.to_s.should == 'http://host:80/'

       expected: "http://host:80/"
            got: "http://host/" (using ==)
     # ./spec/redirect_spec.rb:348:in `block (4 levels) in <top (required)>'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:226:in `rescue in unbind'
     # ./lib/em-http/http_connection.rb:213:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:1482:in `event_callback'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
     # ./spec/redirect_spec.rb:344:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # EventMachine::ConnectionError:
     #   unable to resolve address: nodename nor servname provided, or not known
     #   /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:795:in `connect_server'

  6) EventMachine::HttpRequest should keep default https port in redirect url that include it
     Failure/Error: http.last_effective_url.to_s.should == 'https://host:443/'

       expected: "https://host:443/"
            got: "https://host/" (using ==)
     # ./spec/redirect_spec.rb:359:in `block (4 levels) in <top (required)>'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:226:in `rescue in unbind'
     # ./lib/em-http/http_connection.rb:213:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:1482:in `event_callback'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
     # /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
     # ./spec/redirect_spec.rb:355:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # EventMachine::ConnectionError:
     #   unable to resolve address: nodename nor servname provided, or not known
     #   /Users/mboekhoff/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/lib/eventmachine.rb:795:in `connect_server'

Finished in 19.31 seconds (files took 1.36 seconds to load)
170 examples, 6 failures, 2 pending

Failed examples:

rspec ./spec/client_spec.rb:231 # EventMachine::HttpRequest should set content-length to 0 on posts with empty bodies
rspec ./spec/client_spec.rb:812 # EventMachine::HttpRequest should report error if connection was closed by server on client keepalive requests
rspec ./spec/dns_spec.rb:5 # EventMachine::HttpRequest should fail gracefully on an invalid host in Location header
rspec ./spec/external_spec.rb:82 # EventMachine::HttpRequest should detect deflate encoding
rspec ./spec/redirect_spec.rb:343 # EventMachine::HttpRequest should keep default http port in redirect url that include it
rspec ./spec/redirect_spec.rb:354 # EventMachine::HttpRequest should keep default https port in redirect url that include it

127.0.0.1 - - [30/May/2018:16:22:51 BST] "GET /timeout HTTP/1.1" 200 0
- -> /timeout
[2018-05-30 16:22:52] INFO  going to shutdown ...
[2018-05-30 16:23:03] INFO  WEBrick::HTTPServer#start done.

Your first error above might be a WEBrick vs Mongrel thing.

jackorp commented 6 years ago

I fixed the

rspec ./spec/client_spec.rb:231 # EventMachine::HttpRequest should set content-length to 0 on posts with empty bodies

error by using Thin instead of WEBrick so it most probably is WEBrick vs Mongrel thing.

Just FYI I disabled a few tests when I building RPM to get it somehow working, full output is not much different from yours @michielboekhoff, full output:

$ rspec spec
[2018-05-30 18:01:29] INFO  WEBrick 1.4.2
[2018-05-30 18:01:29] INFO  ruby 2.5.1 (2018-03-29) [x86_64-linux]
[2018-05-30 18:01:29] INFO  WEBrick::HTTPServer#start: pid=430 port=8090
..................F..........127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST / HTTP/1.1" 200 26
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "HEAD / HTTP/1.1" 200 0
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /fail HTTP/1.1" 404 0
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_query?hash[]=value1&hash[]=value2 HTTP/1.1" 200 27
- -> /echo_query?hash[]=value1&hash[]=value2
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "PATCH / HTTP/1.1" 200 4
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /authtest HTTP/1.1" 200 7
- -> /authtest
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /authtest HTTP/1.1" 200 7
- -> /authtest
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_length_from_header HTTP/1.1" 200 15
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "DELETE / HTTP/1.1" 200 0
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_length HTTP/1.1" 200 2
- -> /echo_content_length
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /fail HTTP/1.1" 404 0
- -> /fail
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "PUT / HTTP/1.1" 200 4
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST / HTTP/1.1" 200 4
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST / HTTP/1.1" 200 21
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /auth HTTP/1.1" 200 73
- -> /auth
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_query HTTP/1.1" 200 0
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_headers HTTP/1.1" 200 0
- -> /echo_headers
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /auth HTTP/1.1" 200 90
- -> /auth
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 304 0
- -> /
- -> /echo_query
- -> /echo_content_length_from_header
- -> /fail
- -> /?q=test
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /deflate HTTP/1.1" 200 12
- -> /deflate
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /fail_with_nonstandard_response HTTP/1.1" 420 0
- -> /fail_with_nonstandard_response
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
..127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /gzip-large HTTP/1.1" 200 16344
- -> /gzip-large
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_accept_encoding HTTP/1.1" 200 16
- -> /echo_accept_encoding
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_accept_encoding HTTP/1.1" 200 0
- -> /echo_accept_encoding
..127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /relative-location HTTP/1.1" 301 0
- -> /relative-location
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /deflate HTTP/1.1" 200 12
.- -> /deflate
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /set_cookie HTTP/1.1" 200 10
- -> /set_cookie
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /set_multiple_cookies HTTP/1.1" 200 11
- -> /set_multiple_cookies
..127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_cookie HTTP/1.1" 200 5
- -> /echo_cookie
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo_cookie HTTP/1.1" 200 5
- -> /echo_cookie
..127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST / HTTP/1.1" 200 509
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
F...127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_type HTTP/1.1" 200 0
.- -> /echo_content_type
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_type HTTP/1.1" 200 33
.- -> /echo_content_type
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_type HTTP/1.1" 200 19
.- -> /echo_content_type
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_type HTTP/1.1" 200 28
- -> /echo_content_type
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "POST /echo_content_type HTTP/1.1" 200 31
- -> /echo_content_type
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
..127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET / HTTP/1.1" 200 13
- -> /
....127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo-user-agent HTTP/1.1" 200 25
- -> /echo-user-agent
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo-user-agent HTTP/1.1" 200 2
- -> /echo-user-agent
.127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /echo-user-agent HTTP/1.1" 200 3
.- -> /echo-user-agent
..[2018-05-30 18:01:30] ERROR URI::InvalidURIError: bad URI(is not URI?): http://$$$@$!%&^
    /usr/share/ruby/uri/rfc3986_parser.rb:67:in `split'
    /usr/share/ruby/uri/rfc3986_parser.rb:73:in `parse'
    /usr/share/ruby/uri/rfc3986_parser.rb:117:in `convert_to_uri'
    /usr/share/ruby/uri/generic.rb:1101:in `merge'
    /usr/share/ruby/webrick/httpresponse.rb:279:in `setup_header'
    /usr/share/gems/gems/rack-2.0.4/lib/rack/handler/webrick.rb:16:in `setup_header'
    /usr/share/ruby/webrick/httpresponse.rb:209:in `send_response'
    /usr/share/ruby/webrick/httpserver.rb:112:in `run'
    /usr/share/ruby/webrick/server.rb:307:in `block in start_thread'
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /redirect/badhost HTTP/1.1" 301 0
- -> /redirect/badhost
F.F.............127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /proxyauth?q=test HTTP/1.1" 200 4
- -> /proxyauth?q=test
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /echo_authorization_header HTTP/1.1" 200 32
- -> /echo_authorization_header
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /?q=test HTTP/1.1" 200 4
- -> /?q=test
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
.....127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
..127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "POST / HTTP/1.1" 200 13
.- -> /
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "POST / HTTP/1.1" 200 15
- -> /
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "POST / HTTP/1.1" 200 0
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
- -> /
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "HEAD / HTTP/1.1" 200 0
- -> /
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "DELETE / HTTP/1.1" 200 0
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "PUT / HTTP/1.1" 200 0
..- -> /
- -> /
..127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "POST / HTTP/1.1" 200 0
- -> /
...127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/created HTTP/1.1" 201 13
.- -> /redirect/created
...127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "HEAD /redirect/head HTTP/1.1" 301 0
- -> /redirect/head
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "HEAD / HTTP/1.1" 200 0
.- -> /
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
- -> /
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
.- -> /redirect
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/bad HTTP/1.1" 301 0
- -> /redirect/bad
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET / HTTP/1.1" 200 13
.- -> /
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/nohost HTTP/1.1" 301 0
.- -> /redirect/nohost
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/timeout HTTP/1.1" 301 0
- -> /redirect/timeout
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/multiple-with-cookie HTTP/1.1" 301 8
- -> /redirect/multiple-with-cookie
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/multiple-with-cookie HTTP/1.1" 301 8
- -> /redirect/multiple-with-cookie
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /gzip HTTP/1.1" 200 30
.- -> /gzip
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect HTTP/1.1" 301 8
- -> /redirect
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /gzip HTTP/1.1" 200 30
- -> /gzip
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/middleware_redirects_1 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_1
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/middleware_redirects_2 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_2
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/middleware_redirects_3 HTTP/1.1" 200 0
- -> /redirect/middleware_redirects_3
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/middleware_redirects_1 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_1
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/middleware_redirects_2 HTTP/1.1" 301 0
- -> /redirect/middleware_redirects_2
127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/http_no_port HTTP/1.1" 301 0
- -> /redirect/http_no_port
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/https_no_port HTTP/1.1" 301 0
- -> /redirect/https_no_port
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/http_with_port HTTP/1.1" 301 0
- -> /redirect/http_with_port
F127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/https_with_port HTTP/1.1" 301 0
- -> /redirect/https_with_port
F127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/ignore_query_option?ignore=1 HTTP/1.1" 301 0
- -> /redirect/ignore_query_option?ignore=1
.127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /redirect/url HTTP/1.1" 200 34
- -> /redirect/url
..

Failures:

  1) EventMachine::HttpRequest should set content-length to 0 on posts with empty bodies
     Failure/Error: http.response.strip.split(':')[1].should == '0'

       expected: "0"
            got: nil (using ==)
     # ./spec/client_spec.rb:239:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:151:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:191:in `succeed'
     # ./lib/em-http/client.rb:113:in `unbind'
     # ./lib/em-http/client.rb:71:in `on_request_complete'
     # ./lib/em-http/http_connection.rb:137:in `block in post_init'
     # ./lib/em-http/http_connection.rb:152:in `<<'
     # ./lib/em-http/http_connection.rb:152:in `receive_data'
     # ./lib/em-http/http_connection.rb:23:in `receive_data'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/client_spec.rb:232:in `block (2 levels) in <top (required)>'

  2) EventMachine::HttpRequest should report error if connection was closed by server on client keepalive requests
     Failure/Error: req.callback { failed(http) }

     NameError:
       undefined local variable or method `http' for #<RSpec::ExampleGroups::EventMachineHttpRequest_2:0x00005563fcc0c820>
     # ./spec/client_spec.rb:820:in `block (5 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:151:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:191:in `succeed'
     # ./lib/em-http/client.rb:113:in `unbind'
     # ./lib/em-http/client.rb:71:in `on_request_complete'
     # ./lib/em-http/http_connection.rb:137:in `block in post_init'
     # ./lib/em-http/http_connection.rb:152:in `<<'
     # ./lib/em-http/http_connection.rb:152:in `receive_data'
     # ./lib/em-http/http_connection.rb:23:in `receive_data'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/client_spec.rb:813:in `block (2 levels) in <top (required)>'

  3) EventMachine::HttpRequest should fail gracefully on an invalid host in Location header
     Failure/Error: http.error.should match('unable to resolve server address')
       expected "connection closed by server" to match "unable to resolve server address"
     # ./spec/dns_spec.rb:10:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/client.rb:117:in `unbind'
     # ./lib/em-http/http_connection.rb:205:in `block in unbind'
     # ./lib/em-http/http_connection.rb:205:in `map'
     # ./lib/em-http/http_connection.rb:205:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:1482:in `event_callback'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/dns_spec.rb:6:in `block (2 levels) in <top (required)>'

  4) EventMachine::HttpRequest should fail GET on invalid host
     Failure/Error: http.error.should match(/unable to resolve server address/)

       expected "unable to resolve address: Name or service not known" to match /unable to resolve server address/
       Diff:
       @@ -1,2 +1,2 @@
       -/unable to resolve server address/
       +"unable to resolve address: Name or service not known"
     # ./spec/dns_spec.rb:34:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:86:in `block in activate_connection'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:978:in `block in run_deferred_callbacks'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:975:in `times'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:975:in `run_deferred_callbacks'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/dns_spec.rb:29:in `block (2 levels) in <top (required)>'

  5) EventMachine::HttpRequest should keep default http port in redirect url that include it
     Failure/Error: http.last_effective_url.to_s.should == 'http://host:80/'

       expected: "http://host:80/"
            got: "http://host/" (using ==)
     # ./spec/redirect_spec.rb:348:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:226:in `rescue in unbind'
     # ./lib/em-http/http_connection.rb:213:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:1482:in `event_callback'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/redirect_spec.rb:344:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # EventMachine::ConnectionError:
     #   unable to resolve address: Name or service not known
     #   /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:795:in `connect_server'

  6) EventMachine::HttpRequest should keep default https port in redirect url that include it
     Failure/Error: http.last_effective_url.to_s.should == 'https://host:443/'

       expected: "https://host:443/"
            got: "https://host/" (using ==)
     # ./spec/redirect_spec.rb:359:in `block (4 levels) in <top (required)>'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:158:in `set_deferred_status'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/em/deferrable.rb:198:in `fail'
     # ./lib/em-http/client.rb:123:in `on_error'
     # ./lib/em-http/http_connection.rb:226:in `rescue in unbind'
     # ./lib/em-http/http_connection.rb:213:in `unbind'
     # ./lib/em-http/http_connection.rb:31:in `unbind'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:1482:in `event_callback'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run_machine'
     # /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:195:in `run'
     # ./spec/redirect_spec.rb:355:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # EventMachine::ConnectionError:
     #   unable to resolve address: Name or service not known
     #   /usr/share/gems/gems/eventmachine-1.2.6/lib/eventmachine.rb:795:in `connect_server'

Finished in 0.88673 seconds (files took 1.33 seconds to load)
129 examples, 6 failures

Failed examples:

rspec ./spec/client_spec.rb:231 # EventMachine::HttpRequest should set content-length to 0 on posts with empty bodies
rspec ./spec/client_spec.rb:812 # EventMachine::HttpRequest should report error if connection was closed by server on client keepalive requests
rspec ./spec/dns_spec.rb:5 # EventMachine::HttpRequest should fail gracefully on an invalid host in Location header
rspec ./spec/dns_spec.rb:28 # EventMachine::HttpRequest should fail GET on invalid host
rspec ./spec/redirect_spec.rb:343 # EventMachine::HttpRequest should keep default http port in redirect url that include it
rspec ./spec/redirect_spec.rb:354 # EventMachine::HttpRequest should keep default https port in redirect url that include it

127.0.0.1 - - [30/May/2018:18:01:31 CEST] "GET /timeout HTTP/1.1" 200 0
- -> /timeout
127.0.0.1 - - [30/May/2018:18:01:30 CEST] "GET /timeout HTTP/1.1" 200 0
- -> /timeout
[2018-05-30 18:01:31] INFO  going to shutdown ...
[2018-05-30 18:01:31] INFO  WEBrick::HTTPServer#start done.
michielboekhoff commented 6 years ago

I believe the underlying issue then is that Mongrel is being used. I've opened #319 which is to migrate away from Mongrel. Shall we pick up the discussion on there, @jackorp?

jackorp commented 6 years ago

Ok, I agree.