run overflow forecast a 2nd time as regression test for elastic/ml-cpp#110 (#30969)

Improve test to run overflow forecast a 2nd time as regression test for elastic/ml-cpp#110
This commit is contained in:
Hendrik Muhs 2018-06-05 08:52:06 +02:00 committed by GitHub
parent 500094f5c8
commit 5e48ba7cbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -239,8 +239,6 @@ public class ForecastIT extends MlNativeAutodetectIntegTestCase {
throw e; throw e;
} }
closeJob(job.getId());
List<ForecastRequestStats> forecastStats = getForecastStats(); List<ForecastRequestStats> forecastStats = getForecastStats();
assertThat(forecastStats.size(), equalTo(1)); assertThat(forecastStats.size(), equalTo(1));
ForecastRequestStats forecastRequestStats = forecastStats.get(0); ForecastRequestStats forecastRequestStats = forecastStats.get(0);
@ -248,6 +246,21 @@ public class ForecastIT extends MlNativeAutodetectIntegTestCase {
assertThat(forecastRequestStats.getRecordCount(), equalTo(8000L)); assertThat(forecastRequestStats.getRecordCount(), equalTo(8000L));
assertThat(forecasts.size(), equalTo(8000)); 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 { private void createDataWithLotsOfClientIps(TimeValue bucketSpan, Job.Builder job) throws IOException {