Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365808 - [Unit Test Failure][0.2/4.2][0.2/3.8] org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests
Summary: [Unit Test Failure][0.2/4.2][0.2/3.8] org.eclipse.emf.facet.widgets.nattable....
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EMF-Facet (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Gregoire Dupe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 365078 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-12-06 15:55 EST by Gregoire Dupe CLA
Modified: 2020-05-01 11:27 EDT (History)
2 users (show)

See Also:
gdupe: juno+


Attachments
Fix patch (74.17 KB, patch)
2011-12-07 17:30 EST, Gregoire Dupe CLA
gdupe: iplog+
gdupe: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregoire Dupe CLA 2011-12-06 15:55:48 EST
Since https://hudson.eclipse.org/hudson/job/emffacet-nightly/lastCompletedBuild/

org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.selectAllTest
org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.saveTest
org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.selectRowsTest
org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.getSelectionChangedListenersTest
org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.setHideEmptyColumnsTest
org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.testSortColumnsByType
org.eclipse.emf.facet.widgets.nattable.tests.NatTableAPITests.testGetInstantiationMethodHistory
Comment 1 Gregoire Dupe CLA 2011-12-07 05:51:31 EST
I can reproduce the error in may development environment.
Comment 2 Gregoire Dupe CLA 2011-12-07 05:58:46 EST
If I remove the "(timeout = NatTableAPITests.TIMEOUT)" introduced by in revision 1151 (Bug 364693), the tests run properly.
Comment 3 Gregoire Dupe CLA 2011-12-07 17:30:25 EST
Created attachment 208077 [details]
Fix patch

Here is a path to fixing this bug (in my development environment). I had to change some code lines in existing unit test. Please, can anybody review those modifications?

I know that other committers are really busy that why to fix the build I’ll commit this batch without waiting the code review.

The adding of a "(timeout = NatTableAPITests.TIMEOUT)" in the @test annotation implies the execution of the test in a different thread than the test one.

Since the adding of "(timeout = NatTableAPITests.TIMEOUT)", the tests designed to be executed in the UI thread were executed in a non UI thread. This explains the "Invalid thread access" erros.

To solve this problem, I’ve written a new class (SynchronizedNatTableWidget) which implements INatTableWidget, INatTableWidget2 and INatTableWidgetInternal. This class checks if it is called in the UI thread and call the class NatTableWidget within a Display.syncExec(), if needed.

The class NatTableWidget was called by others plug-ins. I had to fix that by replacing the uses of NatTableWidget by uses of INatTableWidgetInternal.

I’ve also moved some test classes from the AllTest test suite to the AllUITeest one because 
 - if we run a test in the UI thread 
 - and if the UI tread test creates a timeout threads
 - and if the code executed in timeout thread the call a SynchronizedNatTableWidget method
	=> this will cause a dead lock because the NatTable widget will be executed in a syncExec (the calling thread is not the UI thread) and this syncExec will have to wait the end of the unit test task executed by the UI thread. Here is the dead lock.
Comment 4 Gregoire Dupe CLA 2011-12-07 17:36:14 EST
Comment on attachment 208077 [details]
Fix patch

I've committed this patch. (Committed revision 1248.)

Let's wait the next build.
Comment 5 Gregoire Dupe CLA 2011-12-08 04:13:42 EST
The NatTableAPITests's unit test are back to normal in the following builds:
 - https://hudson.eclipse.org/hudson/job/emffacet-nightly-3.8/16/
 - https://hudson.eclipse.org/hudson/job/emffacet-nightly/647/
Comment 6 Gregoire Dupe CLA 2011-12-09 05:27:33 EST
*** Bug 365078 has been marked as a duplicate of this bug. ***
Comment 7 Gregoire Dupe CLA 2011-12-26 07:49:03 EST
Can be closed.