Project: Eclipse_Platform_UI
Bug 313899 [Progress] Every user-job causes a busy cursor to be shown for a minimum of 250ms
Reported: 2010-05-21 07:35:53 | Status: verified fixed

When I run a user job ('job.setUser(true)') the UI shows a busy cursor for 250ms, even if the job does not do anything. This becomes apparent when I schedule 20 user-jobs that complete immediately, then the UI shows a busy-cursor for 5 seconds. My expectation is, that the busy cursor is at the maximum shown as long as the job is actually running. Here is a test-case: public class UIJobTest extends TestCase { public void testUIJob() { int count= 20; assertTrue(runEventLoop() < 1000); for (int i=0; i<count; i++) { Job j= new Job("dummy") { @Override protected IStatus run(IProgressMonitor monitor) { return Status.OK_STATUS; } }; j.setUser(true); j.schedule(); } long time = runEventLoop(); assertTrue("Main thread busy for " + time + " ms when runnning " + count + " user jobs.", time < 1000); } private long runEventLoop() { long startTime= System.currentTimeMillis(); Display disp= Display.getCurrent(); assertNotNull(disp); while(disp.readAndDispatch()) { } return System.currentTimeMillis() - startTime; } }

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressMonitorFocusJobDialog.java