Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,18 @@ public void testSearchableSnapshotShardsAreSkippedWithoutQueryingAnyNodeWhenThey

// Either add data outside of the range, or documents that don't have timestamp data
final boolean indexDataWithTimestamp = randomBoolean();
// Add enough documents to have non-metadata segment files in all shards,
// otherwise the mount operation might go through as the read won't be
// blocked
final int numberOfDocsInIndexOutsideSearchRange = between(350, 1000);
if (indexDataWithTimestamp) {
indexDocumentsWithTimestampWithinDate(indexOutsideSearchRange, between(1, 1000), "2020-11-26T%02d:%02d:%02d.%09dZ");
indexDocumentsWithTimestampWithinDate(
indexOutsideSearchRange,
numberOfDocsInIndexOutsideSearchRange,
"2020-11-26T%02d:%02d:%02d.%09dZ"
);
} else {
indexRandomDocs(indexOutsideSearchRange, between(0, 1000));
indexRandomDocs(indexOutsideSearchRange, numberOfDocsInIndexOutsideSearchRange);
}

// Index enough documents to ensure that all shards have at least some documents
Expand Down