diff options
author | Thomas Wolf | 2016-02-28 17:01:27 +0000 |
---|---|---|
committer | Thomas Wolf | 2016-02-28 21:15:08 +0000 |
commit | 18bc49897a1bdc36d85798e14e0be4b9afa7dc03 (patch) | |
tree | de50e132e03a8719e3b7f569c20feb9254fd38bb /org.eclipse.egit.ui.test | |
parent | 656db2d52b013d78d1ad0dc3c2b7b48ea406eac8 (diff) | |
download | egit-18bc49897a1bdc36d85798e14e0be4b9afa7dc03.tar.gz egit-18bc49897a1bdc36d85798e14e0be4b9afa7dc03.tar.xz egit-18bc49897a1bdc36d85798e14e0be4b9afa7dc03.zip |
Test stability: properly wait for refresh jobs in Gitflow test
SWTbot tests shall never ever just sleep(). That's a sure recipe for
an unstable test, and caused the instability in
FeatureFinishSquashHandlerTest. Better wait for a defined job family,
if available, or even better until a defined event occurs.
Here, however, we have neither a family nor an event to wait for.
Resort to waiting until things have quieted down.
Also use setText() instead of typeText(); the latter may fail if the
keyboard layout is unknown to SWTbot (such as my MAC_DE_CH layout).
Change-Id: Ib2e4819a7af91450140a140e2b3f797d24ae9396
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r-- | org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java index e66ff5e1a6..c6c17998a2 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractFeatureFinishHandlerTest.java @@ -96,10 +96,12 @@ public abstract class AbstractFeatureFinishHandlerTest extends AbstractGitflowHa bot.waitUntil(shellIsActive(UIText.FeatureCheckoutHandler_selectFeature)); bot.text().setText("these are not the features you're looking for"); - bot.sleep(300); // wait for filter to hit + // Wait for filter to hit. Minimum delay must be greater than + // FilteredTree.getRefreshJobDelay(). + TestUtil.waitForJobs(500, 5000); assertFalse(bot.tree().hasItems()); - bot.text().selectAll(); - bot.text().typeText(featureName); + bot.text().setText(featureName); + TestUtil.waitForJobs(500, 5000); bot.tree().select(featureName); bot.button("OK").click(); bot.waitUntil(Conditions.waitForJobs(JobFamilies.GITFLOW_FAMILY, "Git flow jobs")); |