diff options
author | Thomas Wolf | 2016-02-17 22:55:36 +0000 |
---|---|---|
committer | Matthias Sohn | 2016-02-17 23:16:32 +0000 |
commit | 74ddeacdd962d001dcd9e10f78d7040fb388c5ab (patch) | |
tree | 12f830b17027e1d935bbf37c7cd12e9bce483c3d | |
parent | 1d92b56ee142365ff5c033bcd006ca9e21ab0d8c (diff) | |
download | egit-74ddeacdd962d001dcd9e10f78d7040fb388c5ab.tar.gz egit-74ddeacdd962d001dcd9e10f78d7040fb388c5ab.tar.xz egit-74ddeacdd962d001dcd9e10f78d7040fb388c5ab.zip |
Test stability: SynchronizeViewGitChangeSetModelTest
The test was looking for a tree node with label "GeneralProject". As
the screenshot from unstable build 8131[1] clearly shows, the node is
labeled "> GeneralProject".
Looks like there's some asynchronous decoration going on, and depending
on whether the test tried to get the node before or after the decorator
ran it would succeed or fail.
Remedy by using TestUtil.getNode(), which only requires a substring
match, instead of SWTBotTreeItem.getNode(), which requires an exact
match. Also relax the assertion on the "<working tree>" node (same as
in the following test method).
There may be more similar problem spots lurking in here.
[1] https://hudson.eclipse.org/egit/job/egit.gerrit/8131/artifact/org.eclipse.egit.ui.test/target/screenshots/shouldRefreshSyncResultAfterWorkspaceChange%28org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest%29.jpeg
Change-Id: If0051411196ac0148f2a6289d1dfba1e3d69f61d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r-- | org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java index 5bf6c062da..0dece5db1a 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/SynchronizeViewGitChangeSetModelTest.java @@ -40,6 +40,7 @@ import org.eclipse.egit.ui.internal.CommonUtils; import org.eclipse.egit.ui.internal.UIText; import org.eclipse.egit.ui.internal.repository.RepositoriesView; import org.eclipse.egit.ui.internal.synchronize.GitChangeSetModelProvider; +import org.eclipse.egit.ui.test.TestUtil; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.Status; import org.eclipse.jgit.lib.Repository; @@ -374,11 +375,12 @@ public class SynchronizeViewGitChangeSetModelTest extends // then SWTBotTreeItem workingTree = getExpandedWorkingTreeItem(); - assertEquals(GitModelWorkingTree_workingTree, workingTree.getText()); + assertTrue(workingTree.getText() + .endsWith(GitModelWorkingTree_workingTree)); // WidgetNotFoundException will be thrown when node named 'new.txt' not // exists - assertNotNull(workingTree.getNode(PROJ1).expand()); - assertNotNull(workingTree.getNode(PROJ1).getNode(newFileName)); + assertNotNull(TestUtil.getNode(workingTree.getItems(), PROJ1) + .getNode(newFileName)); } @Test |