Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-10-23 08:18:03 -0400
committerSteffen Pingel2013-10-23 08:18:03 -0400
commit83f1a9c1db69b251c68a40a81eac2cc5dd1f8bc4 (patch)
treee3b91b3412fe8322090d56c9e247d942c4979f1b
parentd85cf926e55dcd6d37b4c63ce2fcb6ed80d2af5f (diff)
downloadorg.eclipse.mylyn.tasks-83f1a9c1db69b251c68a40a81eac2cc5dd1f8bc4.tar.gz
org.eclipse.mylyn.tasks-83f1a9c1db69b251c68a40a81eac2cc5dd1f8bc4.tar.xz
org.eclipse.mylyn.tasks-83f1a9c1db69b251c68a40a81eac2cc5dd1f8bc4.zip
420165: fix failures due to too fast task submission in
TracTaskDataHandlerXmlRpcTest Change-Id: I4ba997880ee0614c072da99fa8f30eef88b3850f Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=420165
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java3
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java11
2 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
index 683c9be00..352b468ef 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
@@ -199,6 +199,7 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
AbstractTaskAttachmentHandler attachmentHandler = connector.getTaskAttachmentHandler();
ITask task = harness.createTask("attachmentChangesLastModifiedDate");
Date lastModified = task.getModificationDate();
+ harness.getFixture().waitToGuaranteeTaskUpdate();
// XXX the test case fails when comment == null
attachmentHandler.postContent(repository, task, new TextTaskAttachmentSource("abc"), "comment", null, null);
@@ -441,6 +442,8 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
ticket.putBuiltinValue(Key.PRIORITY, "trivial");
client.updateTicket(ticket, "changing priority", null);
+ harness.getFixture().waitToGuaranteeTaskUpdate();
+
// submit conflicting change
try {
taskDataHandler.postTaskData(repository, taskData, null, new NullProgressMonitor());
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
index 3760f2526..f292e801f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/support/TracFixture.java
@@ -197,4 +197,15 @@ public class TracFixture extends TestFixture {
return super.isExcluded() || excluded;
}
+ public void waitToGuaranteeTaskUpdate() {
+ if (getVersion().compareTo("0.12") < 0) {
+ // Trac 0.11 can fail with database errors if subsequent task updates happen too quickly
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
}

Back to the top