Skip to content

Commit

Permalink
Flaky-proof test
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbauman committed May 22, 2024
1 parent 1ac741e commit e34d456
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,18 @@ public void testSearchableSnapshotsInHotPhasePinnedToHotNodes() throws Exception
)
);

// rollover the data stream so searchable_snapshot can complete
indexDocument(client(), dataStream, true);
// Create the data stream.
assertOK(client().performRequest(new Request("PUT", "_data_stream/" + dataStream)));

var backingIndices = getBackingIndices(client(), dataStream);
String firstGenIndex = backingIndices.get(0);
Map<String, Object> indexSettings = getIndexSettingsAsMap(firstGenIndex);
assertThat(indexSettings.get(DataTier.TIER_PREFERENCE), is("data_hot"));

// rollover the data stream so searchable_snapshot can complete
indexDocument(client(), dataStream, true);


final String restoredIndex = SearchableSnapshotAction.FULL_RESTORED_INDEX_PREFIX + firstGenIndex;
assertBusy(() -> {
logger.info("--> waiting for [{}] to exist...", restoredIndex);
Expand Down

0 comments on commit e34d456

Please sign in to comment.