DESCRIPTION

Bug 499791 - fix extremely bad performance in ProgressMonitorFocusJobDialog

Remove dialog's wrapper monitor and replace with an
AccumulatingProgressMonitor

Signed-off-by: Jagger Herman xxx@xxx.xxx
Change-Id: I8ed09a7607092863e1d1089e970bded9b644a80b


COMMENTS

author: Jagger Herman
date: 2016-09-08 21:07:24.000000000

Uploaded patch set 7.

-------------------------------------
author: Brenden Conley
date: 2016-09-08 21:07:30.000000000

Patch Set 7:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/10359/

-------------------------------------
author: Brenden Conley
date: 2016-09-08 21:27:59.000000000

Patch Set 7: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/10359/ : UNSTABLE

-------------------------------------
author: Kelly Potter
date: 2016-09-09 01:30:16.000000000

Patch Set 7:

(7 comments)

Line:18, bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ProgressMonitorUtil.java -> Missing class comment. Suggested text:

Contains static methods for constructing and manipulating progress monitors.

Line:21, bundles/org.eclipse.jface/src/org/eclipse/jface/operation/ProgressMonitorUtil.java -> Make class final

Line:183, tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/AccumulatingProgressMonitorTest.java -> Nit: unnecessary blank line

Line:208, tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/AccumulatingProgressMonitorTest.java -> Tests are expected to run quickly so don't use Thread.sleep(...). Signal a mutex to let the UI thread know this thread has reached this point and then block this thread on a mutex which you signal from the UI thread when you're ready for this thread to continue.

Line:219, tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/AccumulatingProgressMonitorTest.java -> Running this for 3s is unnecessary. Block on a mutex until the background thread reaches the point where you'd want it to sleep, then run the event loop until the event queue is empty. Once the event queue is empty, signal the background thread to continue.

This will verify that eventing happened on the correct thread without the potential for race conditions and without making the test run for so long.

Line:246, tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/AccumulatingProgressMonitorTest.java -> Nit: unnecessary blank line

Line:251, tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/progress/AccumulatingProgressMonitorTest.java -> No need for a second thread in this test. It would be simpler to verify the flow control properties of the monitor if you post a bunch of events to the progress monitor right from the UI thread, run the event loop until it's empty (rather than for 4s), then assert that the number of events posted to the Collector was exactly 1.

That will run about 1000x faster and won't have the potential for flakiness if the task scheduler does something strange.

The first test is sufficient for verifying that the monitor works correctly in the presence of multithreading.

-------------------------------------
author: Gerrit Code Review
date: 2016-09-17 11:01:02.000000000

Change has been successfully merged into the git repository by Kelly Potter

-------------------------------------
