Fix SearchableSnapshotsBlobStoreCacheIntegTests.testBlobStoreCache (#78616)
This test often fails on CI because it does not wait for the data node that hosts the .snapshot-blob-cache primary shard to process the cluster state update and triggers the clean up. Closes #78512
This commit is contained in:
parent
67e310e989
commit
9e271001bc
|
@ -58,6 +58,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
|
@ -327,8 +328,9 @@ public class SearchableSnapshotsBlobStoreCacheIntegTests extends BaseFrozenSearc
|
||||||
logger.info("--> verifying number of documents in index [{}]", restoredAgainIndex);
|
logger.info("--> verifying number of documents in index [{}]", restoredAgainIndex);
|
||||||
assertHitCount(client().prepareSearch(restoredAgainIndex).setSize(0).setTrackTotalHits(true).get(), numberOfDocs);
|
assertHitCount(client().prepareSearch(restoredAgainIndex).setSize(0).setTrackTotalHits(true).get(), numberOfDocs);
|
||||||
|
|
||||||
logger.info("--> deleting indices, maintenance service should clean up snapshot blob cache index");
|
logger.info("--> deleting indices, maintenance service should clean up [{}] docs in system index", numberOfCachedBlobs);
|
||||||
assertAcked(client().admin().indices().prepareDelete("restored-*"));
|
assertAcked(client().admin().indices().prepareDelete("restored-*"));
|
||||||
|
|
||||||
assertBusy(() -> {
|
assertBusy(() -> {
|
||||||
refreshSystemIndex();
|
refreshSystemIndex();
|
||||||
assertHitCount(
|
assertHitCount(
|
||||||
|
@ -338,7 +340,7 @@ public class SearchableSnapshotsBlobStoreCacheIntegTests extends BaseFrozenSearc
|
||||||
.get(),
|
.get(),
|
||||||
0L
|
0L
|
||||||
);
|
);
|
||||||
});
|
}, 30L, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkNoBlobStoreAccess() {
|
private void checkNoBlobStoreAccess() {
|
||||||
|
|
Loading…
Reference in New Issue