Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-07-25 22:12:49 +0000
committerAndrey Loskutov2015-07-25 22:15:25 +0000
commit8bdd0483b8e96f0ae27e843bc4f11d803657a4f4 (patch)
tree6e74282917b5f1b4d933a78176e93bc38b4bba95 /org.eclipse.egit.ui.test
parent9ccebf423f25ce77747981a3e0d7fe9c7b0e4bb1 (diff)
downloadegit-8bdd0483b8e96f0ae27e843bc4f11d803657a4f4.tar.gz
egit-8bdd0483b8e96f0ae27e843bc4f11d803657a4f4.tar.xz
egit-8bdd0483b8e96f0ae27e843bc4f11d803657a4f4.zip
Test stability: log real stack traces before failing test
ConnectProviderOperation seems to be unstable and permanent reason for sporadic test failures. Catch the errors reported by the operation and log them, so that we can at least try to analyze the root cause. Change-Id: Ie522136bef18787405f1189c3ec8f49388a1503d Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java22
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java7
2 files changed, 22 insertions, 7 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
index 2396c126db..19196c19a5 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
@@ -270,7 +270,11 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
textFile2.create(new ByteArrayInputStream("Some more content"
.getBytes(firstProject.getDefaultCharset())), false, null);
- new ConnectProviderOperation(firstProject, gitDir).execute(null);
+ try {
+ new ConnectProviderOperation(firstProject, gitDir).execute(null);
+ } catch (Exception e) {
+ Activator.logError("Failed to connect project to repository", e);
+ }
assertConnected(firstProject);
IProject secondProject = ResourcesPlugin.getWorkspace().getRoot()
@@ -307,7 +311,11 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
// gitignore.create(new ByteArrayInputStream("/.project\n"
// .getBytes(firstProject.getDefaultCharset())), false, null);
- new ConnectProviderOperation(secondProject, gitDir).execute(null);
+ try {
+ new ConnectProviderOperation(secondProject, gitDir).execute(null);
+ } catch (Exception e) {
+ Activator.logError("Failed to connect project to repository", e);
+ }
assertConnected(secondProject);
IFile dotProject = firstProject.getFile(".project");
@@ -495,9 +503,13 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
.getProject(file.getName());
prj.create(desc, null);
prj.open(null);
-
- new ConnectProviderOperation(prj, myRepository
- .getDirectory()).execute(null);
+ try {
+ new ConnectProviderOperation(prj,
+ myRepository.getDirectory()).execute(null);
+ } catch (Exception e) {
+ Activator.logError(
+ "Failed to connect project to repository", e);
+ }
assertConnected(prj);
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
index 2b52d623b2..b50a8a479e 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java
@@ -222,8 +222,11 @@ public abstract class AbstractSynchronizeViewTest extends
textFile2.create(new ByteArrayInputStream("Some more content"
.getBytes(firstProject.getDefaultCharset())), false, null);
TestUtil.waitForJobs(50, 5000);
-
- new ConnectProviderOperation(firstProject, gitDir).execute(null);
+ try {
+ new ConnectProviderOperation(firstProject, gitDir).execute(null);
+ } catch (Exception e) {
+ Activator.logError("Failed to connect project to repository", e);
+ }
assertConnected(firstProject);
}

Back to the top