JDK-6933803 : TEST_BUG: failure of java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java, Windows -server
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2010-03-10
  • Updated: 2013-11-30
  • Resolved: 2013-11-30
Related Reports
Relates :  
Relates :  
Description
TESTFAIL:java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java

Did not see this fail on any other platform, nor with -client on windows.



--------------------------------------------------
TEST: java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java
JDK under test: (C:\temp\jprt\T1\T\020724~1.OHA\TESTPR~1\WINDOW~1.0-P)
openjdk version "1.7.0-2010-03-10-020724.ohair.jdk"
OpenJDK Runtime Environment (build 1.7.0-2010-03-10-020724.ohair.jdk-administrator_2010_03_10_01_56-b00)
Java HotSpot(TM) Server VM (build 17.0-b10, mixed mode)


ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME:   3.687 seconds
messages:
command: build CoreThreadTimeOut
reason: Named class compiled on demand
elapsed time (seconds): 3.687

ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME:   3.578 seconds
messages:
command: compile C:\temp\jprt\T1\T\020724.ohair\source\test\java\util\concurrent\ThreadPoolExecutor\CoreThreadTimeOut.java
reason: .class file out of date or does not exist
elapsed time (seconds): 3.578

ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.Exception: Some tests failed
REASON: Assumed action based on file name: run main CoreThreadTimeOut 
TIME:   0.922 seconds
messages:
command: main CoreThreadTimeOut
reason: Assumed action based on file name: run main CoreThreadTimeOut 
elapsed time (seconds): 0.922
STDOUT:
7 not equal to 10

Passed = 6, failed = 1

STDERR:
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1353)
	at CoreThreadTimeOut.fail(CoreThreadTimeOut.java:36)
	at CoreThreadTimeOut.equal(CoreThreadTimeOut.java:41)
	at CoreThreadTimeOut.main(CoreThreadTimeOut.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at com.sun.javatest.regtest.MainAction$SameVMThread.run(MainAction.java:632)
	at java.lang.Thread.run(Thread.java:717)
java.lang.Exception: Some tests failed
	at CoreThreadTimeOut.main(CoreThreadTimeOut.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:613)
	at com.sun.javatest.regtest.MainAction$SameVMThread.run(MainAction.java:632)
	at java.lang.Thread.run(Thread.java:717)

JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test


TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.Exception: Some tests failed
--------------------------------------------------

Comments
Suggested fix sent to open alias http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-November/023407.html
20-11-2013

Could you add this test to same binaries run, this test is in ProblemList, we need manually exclude it out of ProblemList
06-11-2013

This test has been put into ProblemList, We're waiting for single binary run to ensure this bug is really fixed Local 1000 run doesn't show failure.
06-11-2013

This seems to have been fixed in http://hg.openjdk.java.net/jdk8/tl/jdk/diff/cb3ecb5e4ce5/test/java/util/concurrent/ThreadPoolExecutor/CoreThreadTimeOut.java
20-10-2013

Assigning to Tristan
18-10-2013

PUBLIC COMMENTS The test is flawed: public static void main(String[] args) throws Throwable { final int threadCount = 10; BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(2*threadCount); ThreadPoolExecutor tpe = new ThreadPoolExecutor(threadCount, threadCount, 30, TimeUnit.MILLISECONDS, q); equal(tpe.getCorePoolSize(), threadCount); check(! tpe.allowsCoreThreadTimeOut()); tpe.allowCoreThreadTimeOut(true); check(tpe.allowsCoreThreadTimeOut()); equal(countExecutorThreads(), 0); for (int i = 0; i < threadCount; i++) tpe.submit(new Runnable() { public void run() {}}); equal(countExecutorThreads(), threadCount); Thread.sleep(500); equal(countExecutorThreads(), 0); tpe.shutdown(); check(tpe.allowsCoreThreadTimeOut()); System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); if (failed > 0) throw new Exception("Some tests failed"); } The test assumes that "immediately" after submitting the threadCount jobs, there must still be threadCount threads running in the executor. But 30 milliseconds after the first executor thread completes its task it can terminate due to the setting of coreThreadTimeout to true. So the validity of this test depends on the speed of, and number of processors in, the machine running the test. You would need a barrier in the Runnable submitted to the pool to ensure that all threadCount threads are still alive after the submit loop completes.
11-03-2010