Harmony
  1. Harmony
  2. HARMONY-1625

[drlvm] ThreadGroupTest of classlib fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib, DRLVM
    • Labels:
      None
    • Environment:
      Linux IA32 multiprocessor

      Description

      The org.apache.harmony.luni.tests.java.lang.ThreadGroupTest stably fails if run individually:

      1) <testcase classname="org.apache.harmony.luni.tests.java.lang.ThreadGroupTest" name="test_setMaxPriorityI" time="0.053">
      <failure message="setMaxPriority: Any value smaller than MIN_PRIORITY is adjusted to MIN_PRIORITY. Before: 10 , after: 10" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: setMaxPriority: Any value smaller than MIN_PRIORITY is adjusted to MIN_PRIORITY. Before: 10 , after: 10
      at junit.framework.AssertionFailedError.<init>(AssertionFailedError.java:11)
      at org.apache.harmony.luni.tests.java.lang.ThreadGroupTest.test_setMaxPriorityI(ThreadGroupTest.java:648)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)

      2) <testcase classname="org.apache.harmony.luni.tests.java.lang.ThreadGroupTest" name="test_suspend" time="3.86">
      <error message="The thread group Test group is not empty" type="java.lang.IllegalThreadStateException">java.lang.IllegalThreadStateException: The thread group Test group is not empty
      at java.lang.ThreadGroup.destroy(Unknown Source)
      at org.apache.harmony.luni.tests.java.lang.ThreadGroupTest.test_suspend(ThreadGroupTest.java:856)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)

      3) <testcase classname="org.apache.harmony.luni.tests.java.lang.ThreadGroupTest" name="test_list" time="0.213">
      <failure message="Either 'list' is wrong or other tests are leaving side-effects. Result from list: ----------------- java.lang.ThreadGroup[name=system,maxpri=10] Thread[Thread-1,5,system] Thread[Thread-0,5,system] Thread[System thread,5,system] java.lang.ThreadGroup[name=Finalizer Threads Group,maxpri=10] Thread[FinalizerThread,5,Finalizer Threads Group] java.lang.ThreadGroup[name=activeCount,maxpri=10] java.lang.ThreadGroup[name=Test group,maxpri=10] ----------------- " type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: Either 'list' is wrong or other tests are leaving side-effects.
      Result from list:
      -----------------
      java.lang.ThreadGroup[name=system,maxpri=10]
      Thread[Thread-1,5,system]
      Thread[Thread-0,5,system]
      Thread[System thread,5,system]
      java.lang.ThreadGroup[name=Finalizer Threads Group,maxpri=10]
      Thread[FinalizerThread,5,Finalizer Threads Group]
      java.lang.ThreadGroup[name=activeCount,maxpri=10]
      java.lang.ThreadGroup[name=Test group,maxpri=10]

      -----------------

      at org.apache.harmony.luni.tests.java.lang.ThreadGroupTest.test_list(ThreadGroupTest.java:481)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)

      This test sporadically crashes when all luni tests are run, but that is probably another story.

      1. H-1625_kernel_tests.patch
        0.7 kB
        Elena Semukhina
      2. H-1625_ThreadGroup.patch
        0.9 kB
        Elena Semukhina
      3. H-1625_ThreadGroupTest.patch
        4 kB
        Elena Semukhina
      4. ThreadGroupTest.patch
        4 kB
        Elena Semukhina

        Issue Links

          Activity

          Alexey Varlamov created issue -
          Hide
          Elena Semukhina added a comment -

          1) test_setMaxPriorityI
          The spec for ThreadGroup.setMaxPriority() says:
          If the pri argument is less than Thread.MIN_PRIORITY, the maximum priority of the group remains unchanged.
          The test expects that maximum priority of the group is set to Thread.MIN_PRIORITY. This is a bug in RI and here is a link to the issue report:
          http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4708197

          I suggest to change the test so that it corresponds to spec.

          2) test_suspend fails because it tries to destroy a non-empty group containing suspended threads. I suggest to change the test so that it stops the threads and then destroys the group.

          3) test_list fails because it verifies the length of the output string. The output on drlvm is quite correct but longer than expected. I suggest to change the test so that it checks the output in more smart way.
          NOTE: the test fails now on the current drlvm build due to errors in launcher implementation and should pass after HARMONY-1582 is committed.

          Show
          Elena Semukhina added a comment - 1) test_setMaxPriorityI The spec for ThreadGroup.setMaxPriority() says: If the pri argument is less than Thread.MIN_PRIORITY, the maximum priority of the group remains unchanged. The test expects that maximum priority of the group is set to Thread.MIN_PRIORITY. This is a bug in RI and here is a link to the issue report: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4708197 I suggest to change the test so that it corresponds to spec. 2) test_suspend fails because it tries to destroy a non-empty group containing suspended threads. I suggest to change the test so that it stops the threads and then destroys the group. 3) test_list fails because it verifies the length of the output string. The output on drlvm is quite correct but longer than expected. I suggest to change the test so that it checks the output in more smart way. NOTE: the test fails now on the current drlvm build due to errors in launcher implementation and should pass after HARMONY-1582 is committed.
          Hide
          Elena Semukhina added a comment -

          The patch is attached.

          Show
          Elena Semukhina added a comment - The patch is attached.
          Elena Semukhina made changes -
          Field Original Value New Value
          Attachment ThreadGroupTest.patch [ 12341969 ]
          Elena Semukhina made changes -
          Link This issue depends on HARMONY-1582 [ HARMONY-1582 ]
          Elena Semukhina made changes -
          Link This issue blocks HARMONY-1648 [ HARMONY-1648 ]
          Hide
          Alexei Fedotov added a comment -
          Show
          Alexei Fedotov added a comment - [drlvm] [unit] Blocks http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM
          Hide
          Geir Magnusson Jr added a comment -

          adding classlib as a category - the patch is for classlib

          Show
          Geir Magnusson Jr added a comment - adding classlib as a category - the patch is for classlib
          Geir Magnusson Jr made changes -
          Component/s Classlib [ 12310560 ]
          Elena Semukhina made changes -
          Link This issue depends on HARMONY-1582 [ HARMONY-1582 ]
          Elena Semukhina made changes -
          Link This issue blocks HARMONY-1648 [ HARMONY-1648 ]
          Hide
          Elena Semukhina added a comment -

          After this issue is fixed, ThreadGroupTest.test_suspend() will fail due to HARMONY-1648.

          Show
          Elena Semukhina added a comment - After this issue is fixed, ThreadGroupTest.test_suspend() will fail due to HARMONY-1648 .
          Elena Semukhina made changes -
          Link This issue depends on HARMONY-1648 [ HARMONY-1648 ]
          Hide
          Elena Semukhina added a comment -

          As it was agreed at http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200610.mbox/%3c4534D2CC.9000100@pobox.com%3e, we'd rather follow RI's and j9 ThreadGroup bug for now. So I attach 2 patches:

          H-1625_ThreadGroupTest.patch fixes the test for 2) and 3) above;
          H-1625_ThreadGroup.patch fixes drlvm ThreadGroup.java to have the same bug as RI

          I repeat once more that ThreadGroupTest will fail after these patches are applied due to HARMONY-1648.

          Show
          Elena Semukhina added a comment - As it was agreed at http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200610.mbox/%3c4534D2CC.9000100@pobox.com%3e , we'd rather follow RI's and j9 ThreadGroup bug for now. So I attach 2 patches: H-1625_ThreadGroupTest.patch fixes the test for 2) and 3) above; H-1625_ThreadGroup.patch fixes drlvm ThreadGroup.java to have the same bug as RI I repeat once more that ThreadGroupTest will fail after these patches are applied due to HARMONY-1648 .
          Elena Semukhina made changes -
          Attachment H-1625_ThreadGroup.patch [ 12343162 ]
          Attachment H-1625_ThreadGroupTest.patch [ 12343163 ]
          Hide
          Elena Semukhina added a comment -

          I attached a patch for drlvm kernel ThreadGroupTest.java which should follow RI's bug as well .

          So three H-1625 patches should be applied:
          H-1625ThreadGroup and H-1625_kernel_tests to drlvm/trunk

          and H-1625_ThreadGroupTest to classlib/trunk.

          Show
          Elena Semukhina added a comment - I attached a patch for drlvm kernel ThreadGroupTest.java which should follow RI's bug as well . So three H-1625 patches should be applied: H-1625ThreadGroup and H-1625_kernel_tests to drlvm/trunk and H-1625_ThreadGroupTest to classlib/trunk.
          Elena Semukhina made changes -
          Attachment H-1625_kernel_tests.patch [ 12343347 ]
          Geir Magnusson Jr made changes -
          Assignee Geir Magnusson Jr [ geir ]
          Hide
          Geir Magnusson Jr added a comment -

          I don't understand. Doesn't the testcase already follow the bug if it passes on j9?

          Show
          Geir Magnusson Jr added a comment - I don't understand. Doesn't the testcase already follow the bug if it passes on j9?
          Hide
          Geir Magnusson Jr added a comment -

          Ok, here's what I'm going to do.

          I'm going to commit the patch for kernel test and the patch for DRLVM to put in the same bug as J9/RI

          However, I'm going to ask that you create a new JIRA for the ThreadGroupTest patch so we can treat that separately.

          Please, in the new JIRA, explain what you are trying to fix.

          Show
          Geir Magnusson Jr added a comment - Ok, here's what I'm going to do. I'm going to commit the patch for kernel test and the patch for DRLVM to put in the same bug as J9/RI However, I'm going to ask that you create a new JIRA for the ThreadGroupTest patch so we can treat that separately. Please, in the new JIRA, explain what you are trying to fix.
          Hide
          Geir Magnusson Jr added a comment -

          r467350

          accepted the DRLVM patch and DRLVM test patch

          I'm asking the submitters to open a new JIRA with the classlib specific
          test change proposal. This will make it easier and clearer.

          Show
          Geir Magnusson Jr added a comment - r467350 accepted the DRLVM patch and DRLVM test patch I'm asking the submitters to open a new JIRA with the classlib specific test change proposal. This will make it easier and clearer.
          Geir Magnusson Jr made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Geir Magnusson Jr made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Elena Semukhina added a comment -

          HARMONY-1955 has been created reporting classlib ThreadGroupTest issues.

          Show
          Elena Semukhina added a comment - HARMONY-1955 has been created reporting classlib ThreadGroupTest issues.
          Gavin made changes -
          Link This issue depends on HARMONY-1648 [ HARMONY-1648 ]
          Gavin made changes -
          Link This issue depends upon HARMONY-1648 [ HARMONY-1648 ]

            People

            • Assignee:
              Geir Magnusson Jr
              Reporter:
              Alexey Varlamov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development