Bug #6319

TestWEBrickHTTPRequest and WEBrick::TestFileHandler fail

Added by Vit Ondruch about 2 years ago. Updated almost 2 years ago.

[ruby-core:44437]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
Category:-
Target version:-
ruby -v:ruby 2.0.0dev (2012-04-17 trunk 35368) [x86_64-linux] Backport:

Description

Hi, testing on Fedora Rawhide, I observe several test fails in TestWEBrickHTTPRequest and WEBrick::TestFileHandler. This seems to be the same errors as in #4110, however I am not sure it they are related.

4) Error:
testparse09(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI /'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in
rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/testhttprequest.rb:21:in test_parse_09'
5) Error:
test_continue_sent(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI
/path'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/test_httprequest.rb:347:in
test
continuesent'
6) Error:
test
continuenotsent(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI /path'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in
rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/testhttprequest.rb:363:in test_continue_not_sent'
7) Error:
test_parse_10(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI
/'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/test_httprequest.rb:38:in
test
parse10'
8) Error:
test
parse11(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI /path'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in
rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/test
httprequest.rb:55:in test_parse_11'
9) Error:
test_parse_header2(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI
/foo/bar/../baz?q=a'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/test_httprequest.rb:126:in
testparseheader2'
10) Error:
testsimplerequest(TestWEBrickHTTPRequest):
WEBrick::HTTPStatus::BadRequest: bad URI /'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in
rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/testhttprequest.rb:11:in test_simple_request'
11) Error:
test_make_partial_content(WEBrick::TestFileHandler):
WEBrick::HTTPStatus::BadRequest: bad URI
/'.
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:115:in rescue in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/httprequest.rb:104:in
parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/lib/webrick/https.rb:30:in parse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/test_filehandler.rb:35:in
make
rangeresponse'
/builddir/build/BUILD/ruby-2.0.0-r35368/test/webrick/test
filehandler.rb:47:in `testmakepartial_content'

History

#1 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Yui NARUSE

I'm assigning this to naruse-san because he fixed #4110.

Vit, #4110 is a problem about hostname of a testing system; the tests failed if the hostname started with a number.
So, if this issue is really related, it may be helpful if you tell us the hostname of your system.

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Yui NARUSE about 2 years ago

  • Status changed from Assigned to Feedback

#3 Updated by Vit Ondruch almost 2 years ago

This is my hostname:

hostname

dhcp-25-1.brq.redhat.com

#4 Updated by Yusuke Endoh almost 2 years ago

  • Status changed from Feedback to Assigned

Naruse-san, do you know what is wrong?

Yusuke Endoh mame@tsg.ne.jp

#5 Updated by Yui NARUSE almost 2 years ago

Could you printf debug with following patch?

diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
index 050b5ed..e60a7dd 100644
--- a/lib/webrick/httprequest.rb
+++ b/lib/webrick/httprequest.rb
@@ -112,7 +112,7 @@ module WEBrick
@scriptname = ""
@path
info = @path.dup
rescue
- raise HTTPStatus::BadRequest, "bad URI #{@unparsed_uri}'."
+ raise HTTPStatus::BadRequest, "bad URI
#{@unparsed_uri}'.\n#{$!.inspect} #{$!.message}\n#{$!.backtrace[0,4].join("\n")}"
end

   if /close/io =~ self["connection"]

#6 Updated by Vit Ondruch almost 2 years ago

  • Status changed from Assigned to Closed

Sorry, but I can't reproduce the error any more with ruby 2.0.0dev (2012-04-23 trunk 35432) [x86_64-linux]. I'm closing the issue.

Also available in: Atom PDF