Skip to content

Commit e49a99f

Browse files
author
Hendrik Muhs
committed
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
1 parent 9c1856b commit e49a99f

File tree

1 file changed

+15
-2
lines changed
  • x-pack/qa/ml-native-tests/src/test/java/org/elasticsearch/xpack/ml/integration

1 file changed

+15
-2
lines changed

x-pack/qa/ml-native-tests/src/test/java/org/elasticsearch/xpack/ml/integration/ForecastIT.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,28 @@ public void testOverflowToDisk() throws Exception {
239239
throw e;
240240
}
241241

242-
closeJob(job.getId());
243-
244242
List<ForecastRequestStats> forecastStats = getForecastStats();
245243
assertThat(forecastStats.size(), equalTo(1));
246244
ForecastRequestStats forecastRequestStats = forecastStats.get(0);
247245
List<Forecast> forecasts = getForecasts(job.getId(), forecastRequestStats);
248246

249247
assertThat(forecastRequestStats.getRecordCount(), equalTo(8000L));
250248
assertThat(forecasts.size(), equalTo(8000));
249+
250+
// run forecast a 2nd time
251+
try {
252+
String forecastId = forecast(job.getId(), TimeValue.timeValueHours(1), null);
253+
254+
waitForecastToFinish(job.getId(), forecastId);
255+
} catch (ElasticsearchStatusException e) {
256+
if (e.getMessage().contains("disk space")) {
257+
throw new ElasticsearchStatusException(
258+
"Test likely fails due to insufficient disk space on test machine, please free up space.", e.status(), e);
259+
}
260+
throw e;
261+
}
262+
263+
closeJob(job.getId());
251264
}
252265

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

0 commit comments

Comments
 (0)