Skip to content

Commit

Permalink
Make asserts on schedules existing (having been created) eventual, as…
Browse files Browse the repository at this point in the history
… this is done by design eventually.
  • Loading branch information
michaelsembwever authored and adejanovski committed Sep 13, 2017
1 parent d85d438 commit 3699509
Showing 1 changed file with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,18 @@ public void a_second_daily_repair_schedule_is_added_for_and_keyspace(String clus
public void reaper_has_scheduled_repairs_for_cluster_called(int repairAmount, String clusterName) throws Throwable {
synchronized (BasicSteps.class) {
CLIENTS.parallelStream().forEach(client -> {
List<RepairScheduleStatus> schedules = client.getRepairSchedulesForCluster(clusterName);
LOG.info("Got " + schedules.size() + " schedules");
assertEquals(repairAmount, schedules.size());

await().with().pollInterval(1, SECONDS).atMost(1, MINUTES).until(() -> {
try {
List<RepairScheduleStatus> schedules = client.getRepairSchedulesForCluster(clusterName);
LOG.info("Got " + schedules.size() + " schedules");
assertEquals(repairAmount, schedules.size());
} catch (AssertionError ex) {
LOG.warn(ex.getMessage());
return false;
}
return true;
});
});
}
}
Expand All @@ -464,9 +473,17 @@ public void reaper_has_scheduled_repairs_for_cluster_called(int repairAmount, St
public void reaper_has_scheduled_repairs_for_the_last_added_cluster(int repairAmount) throws Throwable {
synchronized (BasicSteps.class) {
CLIENTS.parallelStream().forEach(client -> {
List<RepairScheduleStatus> schedules = client.getRepairSchedulesForCluster(TestContext.TEST_CLUSTER);
LOG.info("Got " + schedules.size() + " schedules");
assertEquals(repairAmount, schedules.size());
await().with().pollInterval(1, SECONDS).atMost(1, MINUTES).until(() -> {
try {
List<RepairScheduleStatus> schedules = client.getRepairSchedulesForCluster(TestContext.TEST_CLUSTER);
LOG.info("Got " + schedules.size() + " schedules");
assertEquals(repairAmount, schedules.size());
} catch (AssertionError ex) {
LOG.warn(ex.getMessage());
return false;
}
return true;
});
});
}
}
Expand Down

0 comments on commit 3699509

Please sign in to comment.