Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-11-05 12:06:50 -0500
committerAndrey Loskutov2017-11-05 12:06:50 -0500
commit5a691cd0dea8153bd52edf246a2598fc58bf5a9f (patch)
treed9d0022d60b691a040895dc136b98279c007693f
parent590cab1c659ad2eabe5d693e7d2a470e8a6c4dd5 (diff)
downloadeclipse.platform.debug-5a691cd0dea8153bd52edf246a2598fc58bf5a9f.tar.gz
eclipse.platform.debug-5a691cd0dea8153bd52edf246a2598fc58bf5a9f.tar.xz
eclipse.platform.debug-5a691cd0dea8153bd52edf246a2598fc58bf5a9f.zip
Bug 526058 - test should wait for job trigered by AbstractModelProxyI20171108-2000I20171107-2000I20171106-2000I20171106-0630I20171105-2000
This seem to fix the instability of the ContentTests.testLabelUpdatesCompletedOutOfSequence* tests. Change-Id: Ib3b414c4f65076095ba7a9d5fc9c29dc33d8a795 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
index bbec1ca4a..aef5d9fc8 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java
@@ -25,6 +25,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.debug.tests.AbstractDebugTest;
+import org.eclipse.debug.tests.TestUtil;
import org.eclipse.debug.tests.viewer.model.TestModel.TestElement;
import org.eclipse.jface.viewers.TreePath;
@@ -139,7 +140,7 @@ abstract public class ContentTests extends AbstractViewerModelTest implements IT
* use data from stale updates to populate the viewer.<br>
* See bug 210027
*/
- public void testLabelUpdatesCompletedOutOfSequence3() throws Exception {
+ public void testLabelUpdatesCompletedOutOfSequence1() throws Exception {
TestModelWithCapturedUpdates model = new TestModelWithCapturedUpdates();
model.fCaptureLabelUpdates = true;
@@ -151,10 +152,11 @@ abstract public class ContentTests extends AbstractViewerModelTest implements IT
// Set input into the view to update it, but block children updates.
// Wait for view to start retrieving content.
fViewer.setInput(model.getRootElement());
+ TestUtil.waitForJobs(getName(), 300, 5000);
waitWhile(t -> model.fCapturedUpdates.size() < model.getRootElement().fChildren.length, createModelErrorMessage(model));
List<IViewerUpdate> firstUpdates = model.fCapturedUpdates;
- model.fCapturedUpdates = new ArrayList<IViewerUpdate>(2);
+ model.fCapturedUpdates = Collections.synchronizedList(new ArrayList<IViewerUpdate>(2));
// // Change the model and run another update set.
model.getElement(model.findElement("1")).setLabelAppendix(" - changed"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -205,16 +207,17 @@ abstract public class ContentTests extends AbstractViewerModelTest implements IT
// Set input into the view to update it, but block children updates.
// Wait for view to start retrieving content.
fViewer.setInput(model.getRootElement());
+ TestUtil.waitForJobs(getName(), 300, 5000);
waitWhile(t -> model.fCapturedUpdates.size() < model.getRootElement().fChildren.length, createModelErrorMessage(model));
List<IViewerUpdate> firstUpdates = model.fCapturedUpdates;
- model.fCapturedUpdates = new ArrayList<IViewerUpdate>(2);
+ model.fCapturedUpdates = Collections.synchronizedList(new ArrayList<IViewerUpdate>(2));
// Change the model and run another update set.
model.setElementChildren(TreePath.EMPTY, new TestElement[] {
new TestElement(model, "1-new", new TestElement[0]), //$NON-NLS-1$
new TestElement(model, "2-new", new TestElement[0]), //$NON-NLS-1$
});
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
waitWhile(t -> model.fCapturedUpdates.size() < model.getRootElement().fChildren.length, createModelErrorMessage(model));

Back to the top