Skip to content

Commit

Permalink
Apply OpenSearchIntegTestCase::featureFlagSettings by default (opense…
Browse files Browse the repository at this point in the history
…arch-project#5940)

This commit applies any feature flags specified by a child class
override of the featureFlagSettings() method by default. The result is
that test implementations do not have to manually specify the
featureFlagSettings when creating test nodes.

Signed-off-by: Andrew Ross <[email protected]>

Signed-off-by: Andrew Ross <[email protected]>
(cherry picked from commit 7a511dd)
  • Loading branch information
andrross committed Jan 19, 2023
1 parent d72776e commit 8f4bce5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,16 @@

public final class SearchableSnapshotIT extends AbstractSnapshotIntegTestCase {

@BeforeClass
public static void assumeFeatureFlag() {
assumeTrue(
"Searchable snapshot feature flag is enabled",
Boolean.parseBoolean(System.getProperty(FeatureFlags.SEARCHABLE_SNAPSHOT))
);
}

@Override
protected boolean addMockInternalEngine() {
return false;
}

@Override
protected Settings featureFlagSettings() {
return Settings.builder().put(FeatureFlags.SEARCHABLE_SNAPSHOT, "true").build();
}

@Override
protected Settings.Builder randomRepositorySettings() {
final Settings.Builder settings = Settings.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,8 @@ protected Settings nodeSettings(int nodeOrdinal) {
// randomly enable low-level search cancellation to make sure it does not alter results
.put(SearchService.LOW_LEVEL_CANCELLATION_SETTING.getKey(), randomBoolean())
.putList(DISCOVERY_SEED_HOSTS_SETTING.getKey()) // empty list disables a port scan for other nodes
.putList(DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "file");
.putList(DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "file")
.put(featureFlagSettings());
if (rarely()) {
// Sometimes adjust the minimum search thread pool size, causing
// QueueResizingOpenSearchThreadPoolExecutor to be used instead of a regular
Expand Down

0 comments on commit 8f4bce5

Please sign in to comment.