Skip to content

Commit

Permalink
run overflow forecast a 2nd time as regression test for elastic/ml-cp…
Browse files Browse the repository at this point in the history
…p#110 (#30969)

Improve test to run overflow forecast a 2nd time as regression test for elastic/ml-cpp#110
  • Loading branch information
Hendrik Muhs authored Jun 5, 2018
1 parent 500094f commit 5e48ba7
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,28 @@ public void testOverflowToDisk() throws Exception {
throw e;
}

closeJob(job.getId());

List<ForecastRequestStats> forecastStats = getForecastStats();
assertThat(forecastStats.size(), equalTo(1));
ForecastRequestStats forecastRequestStats = forecastStats.get(0);
List<Forecast> forecasts = getForecasts(job.getId(), forecastRequestStats);

assertThat(forecastRequestStats.getRecordCount(), equalTo(8000L));
assertThat(forecasts.size(), equalTo(8000));

// run forecast a 2nd time
try {
String forecastId = forecast(job.getId(), TimeValue.timeValueHours(1), null);

waitForecastToFinish(job.getId(), forecastId);
} catch (ElasticsearchStatusException e) {
if (e.getMessage().contains("disk space")) {
throw new ElasticsearchStatusException(
"Test likely fails due to insufficient disk space on test machine, please free up space.", e.status(), e);
}
throw e;
}

closeJob(job.getId());
}

private void createDataWithLotsOfClientIps(TimeValue bucketSpan, Job.Builder job) throws IOException {
Expand Down

0 comments on commit 5e48ba7

Please sign in to comment.