You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Elena Semukhina (JIRA)" <ji...@apache.org> on 2006/10/26 11:18:16 UTC

[jira] Created: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

[classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1974
                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Elena Semukhina


The test fails rather often when running the whole luni module with the following message:

Incorrect value returned2 
junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
test_getContextClassLoader Success 

or

Incorrect value returned3 
junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
test_getContextClassLoader Success 

It seems that the test should wait until threads are started and then call the enumerate() method.

 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1974?page=comments#action_12449301 ] 
            
Nikolay Kuznetsov commented on HARMONY-1974:
--------------------------------------------

ThreadTest indeed hangs for now. First off all j.l.Thread.stop(Throwable) misses isAlive check on thread, but after that fix, this test still hangs because of the problem described in HARMONY-1789. I'm working on both problems hopefully will provide combined fix soon.

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Attachments: ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1974?page=all ]

Elena Semukhina updated HARMONY-1974:
-------------------------------------

    Attachment: H-1974ThreadTest_2.patch

Alexey, I agree with you that isAlive() check is redundant here.

I ran the test a few times until it failed and discovered that it failed when the number of threads exceeded the length of tarray used for threads enumeration. 

I think the test is incorrect because
1) it assumes that there are no more than 10 threads in main ThreadGroup;
2) it believes that the number of threads in the main ThreadGroup, once counted, cannot change later.

I rewrote the test so that its algorithm was executed in a thread created in a special ThreadGroup. I this case we can be sure that there are no extra threads in this ThreadGroup and enumeration is quite predictable.


> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexey Varlamov
>         Attachments: H-1974ThreadTest_2.patch, ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1974?page=all ]

Elena Semukhina updated HARMONY-1974:
-------------------------------------

     Patch Info: [Patch Available]
    Description: 
The test fails rather often when running the whole luni module with the following message:

Incorrect value returned2 
junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
test_getContextClassLoader Success 

or

Incorrect value returned3 
junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
test_getContextClassLoader Success 

It seems that the test should wait until threads are started and then call the enumerate() method.


 

  was:
The test fails rather often when running the whole luni module with the following message:

Incorrect value returned2 
junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
test_getContextClassLoader Success 

or

Incorrect value returned3 
junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
test_getContextClassLoader Success 

It seems that the test should wait until threads are started and then call the enumerate() method.

 


I attached H-1974ThreadTest_2.patch which fixes the test.


> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexey Varlamov
>         Attachments: H-1974ThreadTest_2.patch, ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1974?page=all ]

Alexey Varlamov reassigned HARMONY-1974:
----------------------------------------

    Assignee: Alexey Varlamov

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexey Varlamov
>         Attachments: ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1974?page=all ]

Alexey Varlamov closed HARMONY-1974.
------------------------------------

    Resolution: Fixed

Elena, I could not reproduce the failure (maybe due to intermittent nature), but the change you suggest looks reasonable.
Applied at r475706, thank you!

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexey Varlamov
>         Attachments: H-1974ThreadTest_2.patch, ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Elena Semukhina (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1974?page=all ]

Elena Semukhina updated HARMONY-1974:
-------------------------------------

    Attachment: ThreadTest.patch

I attached the patch which fixes the test.

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Attachments: ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Alexei Fedotov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1974?page=comments#action_12447803 ] 
            
Alexei Fedotov commented on HARMONY-1974:
-----------------------------------------

Without a patch I see a different behavior for ThreadTest on r472083: the test hangs.

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Attachments: ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1974?page=comments#action_12449458 ] 
            
Nikolay Kuznetsov commented on HARMONY-1974:
--------------------------------------------

Combined fix attached to HARMONY-1789 fixes the problem of hanging ThreadTest.

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Attachments: ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1974) [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1974?page=comments#action_12449660 ] 
            
Alexey Varlamov commented on HARMONY-1974:
------------------------------------------

Elena,

IMHO the check you suggest:
 			firstOne.start();
+            while (!firstOne.isAlive() && waitTime > 0) {

is a bogus: accordingly to API specification, after method start() returns the target thread is already running. I.e. not necessarily it's run() is already being executed, but it is "alive" by definition. If this is not so for DRLVM, it must be a bug of DRLVM.

> [classlib][lini] unit test ThreadTest.test_enumerate$Ljava_lang_Thread() fails intermittently on drlvm
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1974
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1974
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Semukhina
>         Assigned To: Alexey Varlamov
>         Attachments: ThreadTest.patch
>
>
> The test fails rather often when running the whole luni module with the following message:
> Incorrect value returned2 
> junit.framework.AssertionFailedError: Incorrect value returned2 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> or
> Incorrect value returned3 
> junit.framework.AssertionFailedError: Incorrect value returned3 at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11) at org.apache.harmony.luni.tests.java.lang.ThreadTest.test_enumerate$Ljava_lang_Thread(ThreadTest.java:357) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 0.000 
> test_getContextClassLoader Success 
> It seems that the test should wait until threads are started and then call the enumerate() method.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira