summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdithya Chakilam <achakila@codeaurora.org>2021-04-25 23:57:09 -0500
committerAdithya Chakilam <achakila@codeaurora.org>2021-04-26 10:27:09 -0500
commit75c44d0b1dec203859112ad42074eb16839ea353 (patch)
tree13b8a1f5762e788114ce9197fadd8f137d3bf08d
parent93e61dc64debe42eab454e6c268f9c4ee22a78bc (diff)
fixup! Add a test to cover Distributor pruning feature
The createBranch method used earlier doesn't create actual replication task, fix it to create branch using GerritApi instead. Change-Id: I9be784572d17521d329452f81fed224a69f9cddc
-rw-r--r--src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDistributorIT.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDistributorIT.java b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDistributorIT.java
index 5ade68d..3d0dfc1 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDistributorIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationDistributorIT.java
@@ -19,6 +19,7 @@ import static com.google.common.truth.Truth.assertThat;
import com.google.gerrit.acceptance.TestPlugin;
import com.google.gerrit.acceptance.UseLocalDisk;
import com.google.gerrit.acceptance.WaitUtil;
+import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Project;
import com.google.gerrit.server.git.WorkQueue;
import java.time.Duration;
@@ -89,8 +90,9 @@ public class ReplicationDistributorIT extends ReplicationStorageDaemon {
reloadConfig();
String newBranch = "refs/heads/foo_branch";
- createBranch(project, "refs/heads/master", newBranch);
+ createBranch(BranchNameKey.create(project, newBranch));
+ assertThat(listWaitingReplicationTasks(newBranch)).hasSize(1);
deleteWaitingReplicationTasks(newBranch); // This simulates the work being started by other node
assertThat(waitForProjectTaskCount(0, Duration.ofSeconds(TEST_DISTRIBUTION_CYCLE_SECONDS)))