Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: JRuby 1.6.6
    • Fix Version/s: JRuby 1.6.6
    • Component/s: Application Error
    • Labels:
      None
    • Environment:
      Windows 7 Java V1.6.0_27 (32 bits); Linux Fedora 16; OpenJDK 6
    • Number of attachments :
      0

      Description

      When jruby-src-1.6.6.tar.gz is downloaded from http://jruby.org/download, ant test fails:
      A/ on Windows 7 for two reasons:
      1/ On a French version of Windows 7
      test_big_decimal must be changed from assert_equal "10.00", format.format(value) to:
      assert_equal "10,00" format.format(value) (this test does not handle the locale)
      2/ When this is corrected, it fails with the ruby -IC:... command
      B/ on Linux Fedora 16, for one reason:
      run-junit-interpreted-short:
      [echo] compile=OFF, jit.threshold=20, jit.maxsize=1000000000, jit.max=-1, objectspace=false threadpool=false reflection=false version=ruby1_8
      [junit] WARNING: multiple versions of ant detected in path for junit
      [junit] jar:file:/usr/share/java/ant.jar!/org/apache/tools/ant/Project.class
      [junit] and jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
      [junit] Testsuite: org.jruby.test.ScriptTestSuite
      [junit] Tests run: 71, Failures: 0, Errors: 0, Time elapsed: 13.272 sec
      [junit]
      [junit] Testsuite: org.jruby.test.JRubyTestSuite
      [junit] LoadError: no such file to load – ubygems
      [junit] Tests run: 98, Failures: 1, Errors: 0, Time elapsed: 144.463 sec
      [junit]
      [junit] ------------- Standard Error -----------------
      [junit] LoadError: no such file to load – ubygems
      [junit] ------------- ---------------- ---------------
      [junit] Testcase: test_load_compiled_ruby_class_from_classpath(org.jruby.test.TestUnitTestSuite$ScriptTest): FAILED
      [junit] Faults encountered running test/test_load_compiled_ruby_class_from_classpath, complete output follows:
      [junit] Failure:
      [junit] test_loading_compiled_ruby_class_from_jar(LoadCompiledRubyClassFromClasspathTest)
      [junit] [./test/test_load_compiled_ruby_class_from_classpath.rb:84:in `test_loading_compiled_ruby_class_from_jar'
      [junit] org/jruby/RubyKernel.java:2074:in `send'
      [junit] org/jruby/RubyArray.java:1614:in `each']:
      [junit] did not get 0 for exit status from running java against the jar.
      [junit] <0> expected but was
      [junit] <1>.
      [junit]
      [junit] junit.framework.AssertionFailedError: Faults encountered running test/test_load_compiled_ruby_class_from_classpath, complete output follows:
      [junit] Failure:
      [junit] test_loading_compiled_ruby_class_from_jar(LoadCompiledRubyClassFromClasspathTest)
      [junit] [./test/test_load_compiled_ruby_class_from_classpath.rb:84:in `test_loading_compiled_ruby_class_from_jar'
      [junit] org/jruby/RubyKernel.java:2074:in `send'
      [junit] org/jruby/RubyArray.java:1614:in `each']:
      [junit] did not get 0 for exit status from running java against the jar.
      [junit] <0> expected but was
      [junit] <1>.
      [junit]
      [junit] at org.jruby.test.TestUnitTestSuite$ScriptTest.runTest(TestUnitTestSuite.java:224)
      [junit]
      [junit]

      BUILD FAILED
      /home/philippe/jruby-1.6.6/build.xml:874: The following error occurred while executing this line:
      /home/philippe/jruby-1.6.6/build.xml:1023: The following error occurred while executing this line:
      /home/philippe/jruby-1.6.6/build.xml:971: Tests failed

        Activity

        Hide
        Philippe Vouters added a comment -

        Finally got a successful $ ant test on my Linux. I suffer from three problems, one of which on my Windows 7 computer (French version)
        1/ A restrictive firewall. I had to add in in my /etc/sysconfig/iptables the line
        -A INPUT -m state --state NEW -m udp -p udp -d 225.4.5.6 --dport 6789 -j ACCEPT
        Without this line this caused test/test_socket.rb to hang
        2/ my ~/.bash_profile has the following line:
        export RUBYOPT=-rubygems
        which caused the Load error on ubygems by JRuby. It has to be unset.
        With this RUBYOPT export set this way this caused test/test_load_compiled_ruby_class_from_classpath.rb to fail
        3/ with $ export LANG=fr_FR.UTF8, test/test_big_decimal.rb fails unless
        it is coded this way:
        #JRUBY-3818
        def test_decimal_format
        require 'java'

        format = java.text.DecimalFormat.new("#,##0.00")
        value = java.math.BigDecimal.new("10")
        assert_equal format.format(10.00), format.format(value)
        end

        Shall redo the C:\jruby-1.6.6> and test on my Windows computer. It suffers from a problem at the end. Shall give more precisions in a future update.

        Show
        Philippe Vouters added a comment - Finally got a successful $ ant test on my Linux. I suffer from three problems, one of which on my Windows 7 computer (French version) 1/ A restrictive firewall. I had to add in in my /etc/sysconfig/iptables the line -A INPUT -m state --state NEW -m udp -p udp -d 225.4.5.6 --dport 6789 -j ACCEPT Without this line this caused test/test_socket.rb to hang 2/ my ~/.bash_profile has the following line: export RUBYOPT=-rubygems which caused the Load error on ubygems by JRuby. It has to be unset. With this RUBYOPT export set this way this caused test/test_load_compiled_ruby_class_from_classpath.rb to fail 3/ with $ export LANG=fr_FR.UTF8, test/test_big_decimal.rb fails unless it is coded this way: # JRUBY-3818 def test_decimal_format require 'java' format = java.text.DecimalFormat.new("#,##0.00") value = java.math.BigDecimal.new("10") assert_equal format.format(10.00), format.format(value) end Shall redo the C:\jruby-1.6.6> and test on my Windows computer. It suffers from a problem at the end. Shall give more precisions in a future update.
        Hide
        Charles Oliver Nutter added a comment -

        Thanks Philippe...once you have a complete summary we'll discuss ways to make the build more robust.

        Show
        Charles Oliver Nutter added a comment - Thanks Philippe...once you have a complete summary we'll discuss ways to make the build more robust.
        Hide
        Philippe Vouters added a comment -

        The JRuby 1.6.6 ant test Windows 7 CMD screen capture (from the start where it begins to fail) is available at https://github.com/Vouters/jruby-openvms/blob/master/jruby-1.6.6-ant_test-Windows_7.txt Both Jruby source kit supplied and my modifications to it behave identically on my Windows 7 under ant test. Ant test on my Linux computer is no longer a problem and displays BUILD SUCCESSFUL in both cases. If you want ant test to successfully run under Windows/MinGW, you have to take into account in your tests that MinGW returns c:/ where JRuby expects C:/
        Regards,
        Philippe

        Show
        Philippe Vouters added a comment - The JRuby 1.6.6 ant test Windows 7 CMD screen capture (from the start where it begins to fail) is available at https://github.com/Vouters/jruby-openvms/blob/master/jruby-1.6.6-ant_test-Windows_7.txt Both Jruby source kit supplied and my modifications to it behave identically on my Windows 7 under ant test. Ant test on my Linux computer is no longer a problem and displays BUILD SUCCESSFUL in both cases. If you want ant test to successfully run under Windows/MinGW, you have to take into account in your tests that MinGW returns c:/ where JRuby expects C:/ Regards, Philippe
        Hide
        Charles Oliver Nutter added a comment -

        Officially we only attempt to pass tests JRuby under cmd.exe and maybe cygwin. The failures you run into (like c:\ versus C:) may be annoying but are probably not fatal.

        I'm having a little trouble following the various failures you have described. Can you let me know when you have a simple list of changes you'd recommend we make or failures you recommend we fix?

        My summary up to now:

        • test_big_decimal.rb should assert proper format for current locale, or otherwise force a specific locale. (on Windows only or everywhere? Your fix looks reasonable...)
        • Dir.glob/Dir[] spec may be too case-sensitive. (on Windows...differences in C:\ versus c:\ cause failures)
        • Socket tests should be skipped or made more robust when it is not possible to open required ports. (test_socket.rb hangs)
        • Environment variables like RUBY_OPT should probably be cleared in the tests, to avoid conflicting flags. (e.g. -rubygems caused failures in test_load_compiled_ruby_class_from_classpath)

        Is this list correct?

        Show
        Charles Oliver Nutter added a comment - Officially we only attempt to pass tests JRuby under cmd.exe and maybe cygwin. The failures you run into (like c:\ versus C:) may be annoying but are probably not fatal. I'm having a little trouble following the various failures you have described. Can you let me know when you have a simple list of changes you'd recommend we make or failures you recommend we fix? My summary up to now: test_big_decimal.rb should assert proper format for current locale, or otherwise force a specific locale. (on Windows only or everywhere? Your fix looks reasonable...) Dir.glob/Dir[] spec may be too case-sensitive. (on Windows...differences in C:\ versus c:\ cause failures) Socket tests should be skipped or made more robust when it is not possible to open required ports. (test_socket.rb hangs) Environment variables like RUBY_OPT should probably be cleared in the tests, to avoid conflicting flags. (e.g. -rubygems caused failures in test_load_compiled_ruby_class_from_classpath) Is this list correct?
        Hide
        Philippe Vouters added a comment -

        Dear Charles,

        For test_big_decimal.rb the problem occurs everywhere as soon as the locale's decimal separator is not the dot. Your format.format(value) is the result of a Java method call and as such is sensitive to the current Java's locale.

        for c:/ (Windows/MinGW) returned instead of C:/ (expected), yes indeed you can make the tests case insensitive.

        For the RUBYOPT environment variable issue (test/test_load_compiled_ruby_class_from_classpath.rb) , my belief is that you can unset it in your build.xml. Note that I do wonder why this test is skipped for SunOS !

        For test_socket.rb, my belief is that you can add to this code a select with a timeout value before the recvfrom. The recfrom caused the hang. You may may then do everything you'd like if the timeout in the select fires up.

        Show
        Philippe Vouters added a comment - Dear Charles, For test_big_decimal.rb the problem occurs everywhere as soon as the locale's decimal separator is not the dot. Your format.format(value) is the result of a Java method call and as such is sensitive to the current Java's locale. for c:/ (Windows/MinGW) returned instead of C:/ (expected), yes indeed you can make the tests case insensitive. For the RUBYOPT environment variable issue (test/test_load_compiled_ruby_class_from_classpath.rb) , my belief is that you can unset it in your build.xml. Note that I do wonder why this test is skipped for SunOS ! For test_socket.rb, my belief is that you can add to this code a select with a timeout value before the recvfrom. The recfrom caused the hang. You may may then do everything you'd like if the timeout in the select fires up.
        Hide
        Charles Oliver Nutter added a comment -

        I fixed test_big_decimal on jruby-1_6 branch (master had a locale-friendly version I copied) and added RUBYOPT and JRUBY_OPTS env var clearing to the junit portion of our test run. That's at least two issues down.

        Show
        Charles Oliver Nutter added a comment - I fixed test_big_decimal on jruby-1_6 branch (master had a locale-friendly version I copied) and added RUBYOPT and JRUBY_OPTS env var clearing to the junit portion of our test run. That's at least two issues down.
        Hide
        Philippe Vouters added a comment -

        Dear Charles,

        It remains work to be done so that ant test displays BUILD SUCCESSFUL under a Windows CMD. The Windows CMD ant test relevant output is viewable at https://github.com/Vouters/jruby-openvms/blob/master/jruby-1.6.6-ant_test-Windows_7.txt I must state I did NOT dig much onto finding the root cause of the failure. If necessary for your daily operations, I can cut'n paste the informations there in a new comment to this problem report. Just let me know. I am still learning the way the JRuby team is organized.

        Best regards to everyone.
        Philippe

        Show
        Philippe Vouters added a comment - Dear Charles, It remains work to be done so that ant test displays BUILD SUCCESSFUL under a Windows CMD. The Windows CMD ant test relevant output is viewable at https://github.com/Vouters/jruby-openvms/blob/master/jruby-1.6.6-ant_test-Windows_7.txt I must state I did NOT dig much onto finding the root cause of the failure. If necessary for your daily operations, I can cut'n paste the informations there in a new comment to this problem report. Just let me know. I am still learning the way the JRuby team is organized. Best regards to everyone. Philippe

          People

          • Assignee:
            Unassigned
            Reporter:
            Philippe Vouters
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: