JDK-8038982 : java/lang/ref/EarlyTimeout.java: elapsed time 981 is less than timeout 1000
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-04-01
  • Updated: 2015-01-21
  • Resolved: 2014-04-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u40Fixed 9 b11Fixed
Related Reports
Relates :  
Relates :  
jdk9 b06 
Intel Xeon 3059 MHz, 24 cores, 144G, Win32 / Windows Server 2008 R2 Enterprise

java.lang.RuntimeException: elapsed time 981 is less than timeout 1000
	at EarlyTimeout.main(EarlyTimeout.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:744)

Perhaps, the same issue as JDK-8038333 or JDK-6853696

This might be due to 15ms offset which currentTimeMillis can experience in Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724397(v=vs.85).aspx Adding threshold to the timeout or using nanoTime for time measurement in the test should help.

A comment may not relate to this bug but one thing I notice: The test should use the high resolution timer (System.nanoTime) to measure the elapsed time.