Matthew Denner created JRUBY-6459:
-------------------------------------
Summary: JRuby head causes rack response to change behaviour
Key: JRUBY-6459
URL: https://jira.codehaus.org/browse/JRUBY-6459
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.7
Environment: # MACHINE INFORMATION
Mac OS X 10.7.2
Macbook Air
2.13GHz Intel Core 2 Duo
4GB 1067 MHz DDR3 RAM
# RVM VERSION
$ rvm version
rvm 1.10.2 by Wayne E. Seguin <[email protected]>, Michal Papis
<[email protected]> [https://rvm.beginrescueend.com/]
# ZSH VERSION
$ zsh --version
zsh 4.3.15 (x86_64-apple-darwin11.2.0)
# GCC VERSION
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)
(LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# JAVA VERSION (same one used for both JRuby installs)
$ java -version
openjdk version "1.7.0-u2-b21"
OpenJDK Runtime Environment (build 1.7.0-u2-b21-20111223)
OpenJDK 64-Bit Server VM (build 23.0-b06, mixed mode)
# MRI 1.9.3 (fails none of the tests, tried up to 1000)
$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
# JRUBY 1.6.6 (which fails none of the tests, tried up to 1000)
$ jruby --version
jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572) (OpenJDK 64-Bit Server VM
1.7.0-u2-b21) [darwin-amd64-java]
# JRUBY HEAD (which fails *some* of the *identical* tests!)
jruby-head @ 2cb0cf6
$ jruby --version
jruby 1.7.0.dev (ruby-1.9.3-p28) (2012-02-16 37928de) (OpenJDK 64-Bit Server
VM 1.7.0-u2-b21) [darwin-amd64-java]
Reporter: Matthew Denner
Assignee: Thomas E Enebo
Attachments: jruby-weird-bug.tar.gz
I have a Sinatra app that I'm working on that does very little and I'm testing
it using RSpec 2. It has 48 tests in it and, under jruby-head (SHA: 2cb0cf6)
it will fail the last 23 tests; run it under MRI 1.9.3 or JRuby 1.6.6 and
everything runs fine. The failures appear to be Rack::MockResponse#status
changing behaviour: when it's fine it works, when it fails it suddenly starts
returning the response headers hash.
I've reduced the code to the bare minimum that triggers it on my machine and
attached that as a tar.gz file. There's a bundler Gemfile with Gemfile.lock to
ensure the same gem versions are used, and an .rvmrc file that I've been using.
Note that the .rvmrc file sets 1.9 support but it doesn't actually matter,
it'll still fail.
The included tests are *extremely* simple: make 26 GET requests to a Sinatra
app that only handles GET. As the Sinatra app stands it will cause the last
test to fail. Add the 'after' hook code (commented out in the source file) and
2 tests will fail. I haven't tried this on different machines to see if it's
something about the environment. When they do fail they do so with one of 4
different errors:
undefined method `to_i' for #<Hash:0x10d1ae41>
undefined method `merge!' for nil:NilClass
undefined method `[]=' for nil:NilClass
undefined method `to_i' for #<Hash:0x15f1192d>
I believe that the errors I'm seeing with the enclosed code might be slightly
different (i.e. it might not be Rack::MockResponse#status that's varying) but
it's definitely the same behaviour (i.e. *something* isn't doing what it
should!)
I've marked this as a Major bug as this code isn't in production and JRuby
1.6.6 works as an alternative. However, we couldn't use this in a production
environment if this is a problem in JRuby.
Oh, because of the behaviour of the errors: please tell me this isn't my RAM
failing on my machine!
Thanks,
Matthew
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email