Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362476

Summary: SWTBotTable seems to fail on Ubuntu 11.04
Product: [Technology] SWTBot Reporter: Mickael Istria <mistria>
Component: SWTBotAssignee: Project Inbox <swtbot-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: KetanPadegaonkar, mariot.chauvin
Version: 2.0.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 359024    
Attachments:
Description Flags
Patch that avoids creation of multiple Displays mistria: review?

Description Mickael Istria CLA 2011-10-31 08:34:19 EDT
Using a "normal" Ubuntu 11.04 with "Unity" desktop, the SWTBotTableClickTest fails while to works well with Ubuntu 10.10 and Gnome desktop.
Comment 1 Mickael Istria CLA 2011-11-03 10:05:40 EDT
I succeed to reproduce this wrong behavior locally on my Ubuntu 10.10, by opening the test case in Eclipse IDE, right-click, Run As > Junit Test
Comment 2 Mickael Istria CLA 2011-11-03 10:13:26 EDT
Step-by-step debug gets the test working. I suspect this to be an issue in synchronization that makes that several displays can get created and the RunUIThreadRule does not have the right one.
Comment 3 Mickael Istria CLA 2011-11-03 10:54:41 EDT
This branch seems to contain the right fix: https://github.com/mickaelistria/swtbot/tree/362476

See commit https://github.com/mickaelistria/swtbot/commit/455c1ec5f2561add41e0b9117dde7a7f2d36cfdc

The issue was indeed that there were 2 Displays instantiated: one by the UIThread, and one by the snippet. Then I replaced code in the test - copying most of the main() method of the snippet - in order to use the current display instead of creating a new one.
Comment 4 Ketan Padegaonkar CLA 2011-11-03 11:50:28 EDT
(In reply to comment #3)
> This branch seems to contain the right fix:
> https://github.com/mickaelistria/swtbot/tree/362476
> 
> See commit
> https://github.com/mickaelistria/swtbot/commit/455c1ec5f2561add41e0b9117dde7a7f2d36cfdc
> 
> The issue was indeed that there were 2 Displays instantiated: one by the
> UIThread, and one by the snippet. Then I replaced code in the test - copying
> most of the main() method of the snippet - in order to use the current display
> instead of creating a new one.

Would you mind attaching the patch here, and I'll check it in?

Thanks!
Comment 5 Mickael Istria CLA 2011-11-03 11:54:15 EDT
Can't you merge the branch into the master? There is nothing else than this fix in it.
Comment 6 Mickael Istria CLA 2011-11-03 13:01:53 EDT
I made a fix to this fix, available on the same branch, that removes some code
to handle event and dispose display, since this is the responsibility of the
UIThread.
Comment 7 Ketan Padegaonkar CLA 2011-11-03 13:10:56 EDT
(In reply to comment #5)
> Can't you merge the branch into the master? There is nothing else than this fix
> in it.

AFAIK, eclipse requires that all changes that land up on master are submitted through bugzilla.
Comment 8 Ketan Padegaonkar CLA 2011-11-03 13:12:52 EDT
(In reply to comment #5)
> Can't you merge the branch into the master? There is nothing else than this fix
> in it.

(fat fingered previous reply)

AFAIK, eclipse requires that all changes that land up on master are submitted through bugzilla. Please attach a patch generated using git format-patch and I'll add it in.
Comment 9 Mickael Istria CLA 2011-11-03 13:48:53 EDT
Ok, I'll do that hopefully within a few minutes (tests in progress).
Comment 10 Mickael Istria CLA 2011-11-03 14:02:00 EDT
Ketan, I need your help in Git: I have several Git commits for this bug fix. Should I provide one patch for each commit, or is there a way to aggregate patches ?
Comment 11 Mickael Istria CLA 2011-11-03 14:57:40 EDT
Created attachment 206427 [details]
Patch that avoids creation of multiple Displays
Comment 12 Mickael Istria CLA 2013-05-30 03:00:16 EDT
I could not reproduce this issue, and all tests are working well.