harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey A. Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2438) [classlib][swing] intermittent failures of swing module tests, once mode
Date Thu, 07 Dec 2006 13:13:24 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-2438?page=all ]

Alexey A. Ivanov updated HARMONY-2438:
--------------------------------------

    Attachment: H2438-j.s.Timer_MultithreadedTest.patch

H2438-j.s.Timer_MultithreadedTest.patch fixes problems with testIsRunning() and testSetLogTimers().

testSetLogTimers(): the reason why it failed was that a local variable (for the test method)
was used for timer manipulations. Because of that the timer was not stopped (tearDown stops
the timer). Since there were running many timers, any of them could write to the stream after
the timer watched and before setLogTimers(false) was called.

testIsRunning(): the test starts timer, then asserts timer is running, waits for timer ring
and checks that timer stopped itself. Because in the implementation Timer.stop() is called
after the notifying listeners, it can happen that the listener was notified and thus unlocked
the test thread. The test thread reached the problem assertion before the timer was actually
stopped.
To prevent this, I've added several new asserts to the test: the first asserts the timer rang,
then listener is reset and put to wait state once again. Afterwards the test now asserts that
the timer didn't ring once more, and at last the assert that timer is not running any more.
Another solution that could be used here is to move Timer.stop before notifying listeners.
However, if timer repeats, a new timer event could be posted before the previous event was
passed to all listeners (this can be a problem only where timer is coalesce which is the default.)

I've also removed Mikhail's update because it gives no real clue which timer wrote to the
stream. Moreover since timer events are called from another thread, the failed assertion is
not passed to JUnit. Thus the problem is hidden.
To make the code more readable I've added blank lines to test methods.

> [classlib][swing] intermittent failures of swing module tests, once mode
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-2438
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2438
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Win XP, msvc, debug
>            Reporter: tatyana doubtsova
>         Assigned To: Mikhail Loenko
>         Attachments: H2438-j.s.Timer_MultithreadedTest.patch, patch-2438-exclude.windows.txt
>
>
> Iteratively runnig swing module tests in once mode on IBM VME, classlib revision 482148,
> I observed 9 intermittent failures (see also HARMONY-2282):
> 1). 1 time out of 10
> javax.swing.DefaultCellEditorTest@ testGetComponent
>  testGetSetClickCountToStart
> testGetTreeCellEditorComponent
> testGetTableCellEditorComponent
> all of the tests cases:
> Test interrupted due timeout
> junit.framework.AssertionFailedError: Test interrupted due timeout at javax.swing.BasicSwingTestCase.runBare(BasicSwingTestCase.java:147)
> 2). 1 time out of 10
> javax.swing.DefaultComboBoxModelTest
> all of the test cases:
> Test interrupted due timeout
> junit.framework.AssertionFailedError: Test interrupted due timeout at javax.swing.BasicSwingTestCase.runBare(BasicSwingTestCase.java:147)
> 3). 1 time out of 10 
> javax.swing.TransferHandlerTest@ testGetSourceActions
> Error
> N/A
> java.lang.ArrayIndexOutOfBoundsException at java.util.Arrays.mergeSort(Arrays.java:2545)
at java.util.Arrays.mergeSort(Arrays.java:2516) at java.util.Arrays.mergeSort(Arrays.java:2517)
at java.util.Arrays.sort(Arrays.java:2872) at java.util.Arrays.sort(Arrays.java:2889) at java.beans.BeanInfoWrapper.getPropertyDescriptors(BeanInfoWrapper.java:77)
at javax.swing.TransferHandler.getSourceActions(TransferHandler.java:289) at javax.swing.TransferHandlerTest.testGetSourceActions(TransferHandlerTest.java:222)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117)
at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:81) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:133)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
> 4). 2 times out of 10
> javax.swing.border.BevelBorderTest@ testReadWriteObject
> Error
> N/A
> java.lang.ArrayIndexOutOfBoundsException at java.util.Arrays.mergeSort(Arrays.java:2543)
at java.util.Arrays.mergeSort(Arrays.java:2517) at java.util.Arrays.sort(Arrays.java:2872)
at java.util.Arrays.sort(Arrays.java:2889) at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:54)
at java.io.ObjectStreamClass.addToCache(ObjectStreamClass.java:211) at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:937)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:90) at java.io.ObjectOutputStream.writeClassDescForClass(ObjectOutputStream.java:110)
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1644) at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1956)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1785) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1749)
at javax.swing.BasicSwingTestCase.serializeObject(BasicSwingTestCase.java:496) at javax.swing.border.BevelBorderTest.testReadWriteObject(BevelBorderTest.java:456)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117)
at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:81) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:133)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
> 5). 2 times out of 10
> javax.swing.border.CompoundBorderTest@ testReadWriteObject
> Error
> N/A
> java.lang.ArrayIndexOutOfBoundsException at java.util.Arrays.mergeSort(Arrays.java:2535)
at java.util.Arrays.sort(Arrays.java:2872) at java.util.Arrays.sort(Arrays.java:2889) at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:54)
at java.io.ObjectStreamClass.addToCache(ObjectStreamClass.java:211) at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:937)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:90) at java.io.ObjectOutputStream.writeClassDescForClass(ObjectOutputStream.java:110)
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1644) at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1956)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1785) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1749)
at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1234) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:39)
at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1334) at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1675)
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1956) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1785)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1749) at javax.swing.BasicSwingTestCase.serializeObject(BasicSwingTestCase.java:496)
at javax.swing.border.CompoundBorderTest.testReadWriteObject(CompoundBorderTest.java:24) at
java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117)
at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:81) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:133)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
> 6). 2 times out of 10
> javax.swing.border.EtchedBorderTest@ testReadWriteObject
> Error
> N/A
> java.lang.ArrayIndexOutOfBoundsException at java.util.Arrays.mergeSort(Arrays.java:2545)
at java.util.Arrays.sort(Arrays.java:2872) at java.util.Arrays.sort(Arrays.java:2889) at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:54)
at java.io.ObjectStreamClass.addToCache(ObjectStreamClass.java:211) at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:937)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:90) at java.io.ObjectOutputStream.writeClassDescForClass(ObjectOutputStream.java:110)
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1644) at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1956)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1785) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1749)
at javax.swing.BasicSwingTestCase.serializeObject(BasicSwingTestCase.java:496) at javax.swing.border.EtchedBorderTest.testReadWriteObject(EtchedBorderTest.java:32)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117)
at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:81) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:133)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
> 7). 2 times out of 10
> javax.swing.border.LineBorderTest@ testReadWriteObject
> Error
> javax.swing.border.LineBorder; IllegalAccessException
> java.io.InvalidClassException: javax.swing.border.LineBorder; IllegalAccessException
at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1873) at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:820)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:218) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:260)
at javax.swing.BasicSwingTestCase.serializeObject(BasicSwingTestCase.java:52) at javax.swing.border.LineBorderTest.testReadWriteObject(LineBorderTest.java:236)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117)
at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:81) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:133)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
> 8). 2 times out of 10
> javax.swing.border.TitledBorderTest@ testReadWriteObject
> Error
> N/A
> java.lang.ArrayIndexOutOfBoundsException at java.util.Arrays.mergeSort(Arrays.java:2545)
at java.util.Arrays.mergeSort(Arrays.java:2517) at java.util.Arrays.sort(Arrays.java:2872)
at java.util.Arrays.sort(Arrays.java:2889) at java.io.ObjectStreamClass.computeSerialVersionUID(ObjectStreamClass.java:417)
at java.io.ObjectStreamClass.addToCache(ObjectStreamClass.java:211) at java.io.ObjectStreamClass.lookupStreamClass(ObjectStreamClass.java:937)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:90) at java.io.ObjectOutputStream.writeClassDescForClass(ObjectOutputStream.java:110)
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1644) at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1956)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1785) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1749)
at javax.swing.BasicSwingTestCase.serializeObject(BasicSwingTestCase.java:496) at javax.swing.border.TitledBorderTest.testReadWriteObject(TitledBorderTest.java:64)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117)
at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:92)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:81) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:133)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
> 9). 2 times out of 10
> javax.swing.Timer_MultithreadedTest@ testSetLogTimers
> Failure
> [3] log's not written
> junit.framework.AssertionFailedError: [3] log's not written at javax.swing.Timer_MultithreadedTest.testSetLogTimers(Timer_MultithreadedTest.java:412)
at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)

-- 
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

       

Mime
View raw message