Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.1.2
-
Fix Version/s: JRuby 1.1.3
-
Component/s: None
-
Labels:None
-
Environment:JDK6 (1.6.0_06) and JDK5 (1.5.0_07) on Solaris 10 (32bit)
-
Testcase included:yes
-
Number of attachments :
Description
One of our rails tests kept on failing intermittently. After some poking around I noticed that it this is caused by Time.now. This test case describes the problem the best:
while (true) do t1=Time.now t2=Time.now if t1 > t2 puts "\n Time shift occurred! #{t1.to_i}.#{t1.usec} > #{t2.to_i}.#{t2.usec}" break else print "." end end
$ jruby test.rb .... 1214278834.151719 > 1214278834.151182
I tried to run the same script on MacOSX (JDK5 and 6) and things work properly, so I wonder if this isn't actually a problem in the Solaris version of JDK.
Issue Links
- relates to
-
JRUBY-2788
Make Time.now monotonically increasing
-
Reproducible on Linux for both MRI and JRuby!
But it takes much more iterations for MRI to find the "time shift" , while JRuby takes just a couple of iterations.
Tried with MRI 1.8.6, 1.8.7, 1.9, all fail. JRuby from trunk.