Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359150 - DisplaySerialization_Test#testTimerExecIsSerializable fails occasionally
Summary: DisplaySerialization_Test#testTimerExecIsSerializable fails occasionally
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-27 18:01 EDT by Ralf Sternberg CLA
Modified: 2011-09-30 10:30 EDT (History)
0 users

See Also:


Attachments
Proposed fix and test (4.49 KB, patch)
2011-09-30 10:05 EDT, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-09-27 18:01:33 EDT
I saw this error both on the build server and in the IDE:
java.lang.NullPointerException
	at java.util.LinkedList.writeObject(LinkedList.java:755)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
	at org.eclipse.rap.rwt.testfixture.Fixture.serialize(Fixture.java:482)
	at org.eclipse.rap.rwt.testfixture.Fixture.serializeAndDeserialize(Fixture.java:494)
	at org.eclipse.swt.widgets.DisplaySerialization_Test.serializeAndDeserialize(DisplaySerialization_Test.java:248)
	at org.eclipse.swt.widgets.DisplaySerialization_Test.testTimerExecIsSerializable(DisplaySerialization_Test.java:218)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Comment 1 Rüdiger Herrmann CLA 2011-09-28 04:53:38 EDT
I tweaked the timing of the test participants. Changes are in CVS HEAD.
Please reopen if the problem reappears.
Comment 2 Ralf Sternberg CLA 2011-09-28 06:42:57 EDT
The test still fails on the build server when checking out from HEAD. I'm positive that the build gets the current version.
Comment 3 Rüdiger Herrmann CLA 2011-09-30 10:05:33 EDT
Created attachment 204383 [details]
Proposed fix and test
Comment 4 Rüdiger Herrmann CLA 2011-09-30 10:30:54 EDT
The exception was caused by concurrent access to the 'tasks' list from the main thread (the one doing the serialization) and the timer thread. The fix was to synchronize access to the 'tasks' list during seriaization.
Changes are in CVS HEAD.