This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 220900 - remove syncExec flags from (query) jobs
Summary: remove syncExec flags from (query) jobs
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-29 04:14 EST by Steffen Pingel CLA
Modified: 2008-04-19 14:35 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2008-02-29 04:14:09 EST
Some methods that spawn asynchronous runnables or jobs have a "syncExec" flag parameter that is set to true when running from tests. This code could be refactored to either return jobs that are then scheduled / run by the test methods or rely on a global flag. The global flag should also be used to suppress password prompting and error dialogs. Platform has examples of similar static flags, e.g.:

 ErrorDialog.AUTOMATED_MODE
 SafeRunnable.setIgnoreErrors()
Comment 1 Eugene Kuleshov CLA 2008-03-02 14:22:50 EST
The global state is usually as harmful as using static calls. It is better to use callbacks or handlers instead of such flags, eg. test could pass password handler that won't be showing password request UI. Those callback can be either passed as parameters or injected as dependencies upon component creation.
Comment 2 Mik Kersten CLA 2008-03-02 18:15:06 EST
Steffen: please add this as a discussion item to an upcoming call.  There is no perfect way of doing this.  We can ask for some advice about this at EclipseCon, since there are benefits to Platform's approach here. 
Comment 3 Eugene Kuleshov CLA 2008-03-02 21:43:58 EST
(In reply to comment #2)
> There is no perfect way of doing this.

Nothing is perfect, but call backs can be generally useful for the headless tools...
Comment 4 Steffen Pingel CLA 2008-04-19 14:35:11 EDT
Done. Calling TasksUi.synchronize*() magically blocks now when running from a test.