Skip to content

Commit

Permalink
Enable SearchableSnapshotIT to run during build (opensearch-project#5937
Browse files Browse the repository at this point in the history
) (opensearch-project#5939)

Previously this test required the feature flag to be set as a system
property, otherwise the test did nothing. This change programmatically
sets the feature flag to allow the test to run during all builds.
I ran the following command overnight (probably at least a couple
thousand iterations) on a dev machine and saw no failures, so I have
confidence this test is not flaky:

```
run-one-until-failure ./gradlew ':server:internalClusterTest' --tests "org.opensearch.snapshots.SearchableSnapshotIT"
```

Signed-off-by: Andrew Ross <andrross@amazon.com>

Signed-off-by: Andrew Ross <andrross@amazon.com>
(cherry picked from commit 901cd69)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

Signed-off-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 37f5c22 commit 023b0bc
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.carrotsearch.randomizedtesting.generators.RandomPicks;
import org.hamcrest.MatcherAssert;
import org.junit.BeforeClass;
import org.opensearch.action.admin.cluster.node.stats.NodesStatsResponse;
import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
import org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
Expand Down Expand Up @@ -43,19 +42,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 nodeSettings(int nodeOrdinal) {
return Settings.builder().put(super.nodeSettings(nodeOrdinal)).put(FeatureFlags.SEARCHABLE_SNAPSHOT, "true").build();
}

@Override
protected Settings.Builder randomRepositorySettings() {
final Settings.Builder settings = Settings.builder();
Expand Down

0 comments on commit 023b0bc

Please sign in to comment.