Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Number of attachments :
      1

      Description

      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

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        All your tests pass on JRuby master (1.7pre2) with or without the hook installed. Thanks for the useful report and reproduction!

        Show
        Charles Oliver Nutter added a comment - All your tests pass on JRuby master (1.7pre2) with or without the hook installed. Thanks for the useful report and reproduction!

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Matthew Denner
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: