Skip to content

Commit

Permalink
Fix SearchableSnapshotsBlobStoreCacheIntegTests.testBlobStoreCache (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
tlrx authored Oct 7, 2021
1 parent 67e310e commit 9e27100
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;

import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
Expand Down Expand Up @@ -327,8 +328,9 @@ public Settings onNodeStopped(String nodeName) throws Exception {
logger.info("--> verifying number of documents in index [{}]", restoredAgainIndex);
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-*"));

assertBusy(() -> {
refreshSystemIndex();
assertHitCount(
Expand All @@ -338,7 +340,7 @@ public Settings onNodeStopped(String nodeName) throws Exception {
.get(),
0L
);
});
}, 30L, TimeUnit.SECONDS);
}

private void checkNoBlobStoreAccess() {
Expand Down

0 comments on commit 9e27100

Please sign in to comment.