diff options
author | Thomas Wolf | 2018-09-10 10:36:25 +0000 |
---|---|---|
committer | Matthias Sohn | 2018-09-10 19:47:22 +0000 |
commit | 1ed88470943a5b05033f0b4a9c42ab4ba11814ab (patch) | |
tree | 737579ccc575135b84eb6460645fab747710f3c9 /org.eclipse.egit.ui.test | |
parent | 7f37ec7cb9729db5ef8db83fdb2cf684c3155dcb (diff) | |
download | egit-1ed88470943a5b05033f0b4a9c42ab4ba11814ab.tar.gz egit-1ed88470943a5b05033f0b4a9c42ab4ba11814ab.tar.xz egit-1ed88470943a5b05033f0b4a9c42ab4ba11814ab.zip |
[releng] Fix unstable HistoryViewTest.testOpenOfDeletedFile()
The file diff viewer newly computes its content asynchronously. Give
that background job a job family, and join on it in the test to ensure
that the expected content is actually there.
Change-Id: I80335bb7540ca8395a1bf10262d9de21bbd944ac
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/test/history/HistoryViewTest.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java index 4f637578a0..911f913139 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java @@ -50,6 +50,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; import org.eclipse.team.ui.history.IHistoryView; +import org.eclipse.ui.PlatformUI; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -265,6 +266,16 @@ public class HistoryViewTest extends LocalRepositoryTestCase { return getHistoryViewBot().table(); } + private SWTBotTable getFileDiffTable() throws Exception { + Job.getJobManager().join(JobFamilies.HISTORY_DIFF, null); + // Wait a little bit to give the UiJob triggered a chance to run + Thread.sleep(100); + // Then join the UI update + PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { + /* empty */ }); + return getHistoryViewBot().table(1); + } + private SWTBot getHistoryViewBot() { return TestUtil.showHistoryView().bot(); } @@ -384,8 +395,7 @@ public class HistoryViewTest extends LocalRepositoryTestCase { assertEquals(commitCount + 1, commitsTable.rowCount()); commitsTable.select(0); - SWTBot viewBot = getHistoryViewBot(); - SWTBotTable fileDiffTable = viewBot.table(1); + SWTBotTable fileDiffTable = getFileDiffTable(); assertEquals(1, fileDiffTable.rowCount()); fileDiffTable.select(0); |