Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,6 @@ tests:
- class: org.elasticsearch.xpack.rank.rrf.RRFRankClientYamlTestSuiteIT
method: test {yaml=rrf/700_rrf_retriever_search_api_compatibility/nested compound retrievers with min_score correctly compute total_hits}
issue: https://github.com/elastic/elasticsearch/issues/142997
- class: org.elasticsearch.index.store.StoreDirectoryMetricsIT
method: testDirectoryMetrics
issue: https://github.com/elastic/elasticsearch/issues/143061
- class: org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT
method: test
issue: https://github.com/elastic/elasticsearch/issues/143023
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.elasticsearch.test.ESIntegTestCase;

import java.io.IOException;
import java.util.Collection;
import java.util.stream.IntStream;

import static org.hamcrest.Matchers.equalTo;
Expand All @@ -30,7 +31,7 @@ public void testDirectoryMetrics() throws IOException {
final String indexName = randomIndexName();
createIndex(indexName, 1, 0);
IntStream.range(0, between(10, 100)).forEach(i -> indexDoc(indexName, "id " + i, "f", i));
flush(indexName);
flushAndRefresh(indexName);

String node = internalCluster().nodesInclude(indexName).iterator().next();

Expand All @@ -41,21 +42,19 @@ public void testDirectoryMetrics() throws IOException {
Tuple<Long, DirectoryMetrics> tuple = indicesService.withDirectoryMetrics(() -> {
try (Engine.Searcher searcher = searchShard.acquireSearcher("test")) {
Directory directory = searcher.getDirectoryReader().directory();
String[] files = directory.listAll();
Collection<String> files = searcher.getDirectoryReader().getIndexCommit().getFileNames();
long reads = 0;
for (String file : files) {
if (file.endsWith("lock") == false) {
IndexInput indexInput = directory.openInput(
file,
file.startsWith(IndexFileNames.SEGMENTS) ? IOContext.READONCE : IOContext.DEFAULT
);
indexInput.readByte();
++reads;
indexInput.seek(directory.fileLength(file) - 1);
indexInput.readByte();
++reads;
indexInput.close();
}
IndexInput indexInput = directory.openInput(
file,
file.startsWith(IndexFileNames.SEGMENTS) ? IOContext.READONCE : IOContext.DEFAULT
);
indexInput.readByte();
++reads;
indexInput.seek(directory.fileLength(file) - 1);
indexInput.readByte();
++reads;
indexInput.close();
}
return reads;
}
Expand Down