Skip to content

Commit

Permalink
Make number of repairs added and aborted configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Jan 19, 2023
1 parent 4cf7a80 commit d911355
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,7 @@ public void startFakeRepairSchedule() {
}

@And("^I add 11 and abort the most recent 10 repairs for cluster \"([^\"]*)\" and keyspace \"([^\"]*)\"$")
public void addAndAbortRepairs(String clusterName, String keyspace) throws Throwable {
public void addAndAbortRepairs(Integer repairsAdded, Integer repairsAborted, String clusterName, String keyspace) throws Throwable {
synchronized (BasicSteps.class) {
testContext.TEST_CLUSTER = (String) clusterName;
Set<String> tables = Sets.newHashSet();
Expand All @@ -2907,7 +2907,7 @@ public void addAndAbortRepairs(String clusterName, String keyspace) throws Throw
params.put("keyspace", keyspace);
params.put("owner", "test_user");

for (int iter = 1; iter < 12; iter++) {
for (int iter = 1; iter <= repairsAdded; iter++) {
Response response = RUNNERS.get(0).callReaper("POST", "/repair_run", Optional.of(params));
String responseData = response.readEntity(String.class);
Assertions
Expand All @@ -2932,7 +2932,7 @@ public void addAndAbortRepairs(String clusterName, String keyspace) throws Throw
.assertThat(response.getStatus())
.isEqualTo(Response.Status.OK.getStatusCode())
.withFailMessage(responseData);
if (iter > 1) {
if (iter > (repairsAdded - repairsAborted)) {
response = RUNNERS.get(0).callReaper(
"PUT",
String.format("repair_run/%s/state/%s", id.toString(), "ABORTED"),
Expand Down

0 comments on commit d911355

Please sign in to comment.