|
@@ -248,9 +248,18 @@ public class DeleteExpiredDataIT extends MlNativeAutodetectIntegTestCase {
|
|
|
// Assert at least one state doc for each job
|
|
|
assertThat(stateDocsResponse.getHits().getTotalHits().value, greaterThanOrEqualTo(5L));
|
|
|
|
|
|
+ int nonExistingJobDocsCount = 0;
|
|
|
+ List<String> nonExistingJobExampleIds = new ArrayList<>();
|
|
|
for (SearchHit hit : stateDocsResponse.getHits().getHits()) {
|
|
|
- assertThat(hit.getId().startsWith("non_existing_job"), is(false));
|
|
|
+ if (hit.getId().startsWith("non_existing_job")) {
|
|
|
+ nonExistingJobDocsCount++;
|
|
|
+ if (nonExistingJobExampleIds.size() < 10) {
|
|
|
+ nonExistingJobExampleIds.add(hit.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ assertThat("Documents for non_existing_job are still around; examples: " + nonExistingJobExampleIds,
|
|
|
+ nonExistingJobDocsCount, equalTo(0));
|
|
|
}
|
|
|
|
|
|
private static Job.Builder newJobBuilder(String id) {
|