diff --git a/test/metadata-extractor/src/main/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractor.java b/test/metadata-extractor/src/main/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractor.java index b3941371f9291..78d40df580bc0 100644 --- a/test/metadata-extractor/src/main/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractor.java +++ b/test/metadata-extractor/src/main/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractor.java @@ -29,6 +29,7 @@ import java.util.Map; import java.util.ServiceLoader; import java.util.Set; +import java.util.stream.Stream; public class HistoricalFeaturesMetadataExtractor { private final ClassLoader classLoader; @@ -92,7 +93,9 @@ void extractHistoricalFeatureMetadata(CheckedBiConsumer featureSpecLoader = ServiceLoader.load(FeatureSpecification.class, classLoader); for (FeatureSpecification featureSpecification : featureSpecLoader) { historicalFeatures.putAll(featureSpecification.getHistoricalFeatures()); - featureSpecification.getFeatures().stream().map(NodeFeature::id).forEach(featureNames::add); + Stream.concat(featureSpecification.getFeatures().stream(), featureSpecification.getTestFeatures().stream()) + .map(NodeFeature::id) + .forEach(featureNames::add); } metadataConsumer.accept(historicalFeatures, featureNames); } diff --git a/test/metadata-extractor/src/test/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractorTests.java b/test/metadata-extractor/src/test/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractorTests.java index a4cfcae198553..28e93a239b3d3 100644 --- a/test/metadata-extractor/src/test/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractorTests.java +++ b/test/metadata-extractor/src/test/java/org/elasticsearch/extractor/features/HistoricalFeaturesMetadataExtractorTests.java @@ -30,6 +30,7 @@ import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.hasEntry; +import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.not; @@ -48,6 +49,7 @@ public void testExtractHistoricalMetadata() throws IOException { }); assertThat(nodeFeatureVersionMap, not(anEmptyMap())); assertThat(featureNamesSet, not(empty())); + assertThat(featureNamesSet, hasItem("test_features_enabled")); Path outputFile = temporaryFolder.newFile().toPath(); extractor.generateMetadataFile(outputFile);