Skip to content

Commit 91b4f32

Browse files
committed
Suppress S3RepositoryAnalysisStrongMpusRestIT in 3rd party runs
This test suite is only meaningful when running against the local test fixture so this commit suppresses it in the third-party test runs. Closes #138762
1 parent 03670a9 commit 91b4f32

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,6 @@ tests:
445445
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
446446
method: test {p0=search/160_exists_query/Test exists query on object field in empty index}
447447
issue: https://github.com/elastic/elasticsearch/issues/138733
448-
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.S3RepositoryAnalysisStrongMpusRestIT
449-
method: testRepositoryAnalysis
450-
issue: https://github.com/elastic/elasticsearch/issues/138762
451448

452449
# Examples:
453450
#

x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/AbstractS3RepositoryAnalysisRestTestCase.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.elasticsearch.common.regex.Regex;
1717
import org.elasticsearch.common.settings.Settings;
1818
import org.elasticsearch.common.unit.ByteSizeValue;
19+
import org.elasticsearch.core.Booleans;
1920
import org.elasticsearch.test.cluster.ElasticsearchCluster;
2021
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
2122

@@ -26,11 +27,14 @@
2627
import static org.hamcrest.Matchers.not;
2728

2829
public abstract class AbstractS3RepositoryAnalysisRestTestCase extends AbstractRepositoryAnalysisRestTestCase {
30+
31+
static final boolean USE_FIXTURE = Booleans.parseBoolean(System.getProperty("tests.use.fixture", "true"));
32+
2933
protected static final Supplier<String> regionSupplier = new DynamicRegionSupplier();
3034

3135
protected static class RepositoryAnalysisHttpFixture extends S3HttpFixture {
32-
RepositoryAnalysisHttpFixture(boolean enabled) {
33-
super(enabled, "bucket", "base_path_integration_tests", fixedAccessKey("s3_test_access_key", regionSupplier, "s3"));
36+
RepositoryAnalysisHttpFixture() {
37+
super(USE_FIXTURE, "bucket", "base_path_integration_tests", fixedAccessKey("s3_test_access_key", regionSupplier, "s3"));
3438
}
3539

3640
private volatile boolean repoAnalysisStarted;
@@ -70,16 +74,16 @@ private void ensurePurposeParameterPresent(S3HttpHandler.S3Request request) {
7074

7175
protected static final String CLIENT_NAME = "repo_test_kit";
7276

73-
protected static ElasticsearchCluster buildCluster(S3HttpFixture s3HttpFixture, boolean enabled) {
77+
protected static ElasticsearchCluster buildCluster(S3HttpFixture s3HttpFixture) {
7478
final var clientPrefix = "s3.client." + CLIENT_NAME + ".";
7579
return ElasticsearchCluster.local()
7680
.distribution(DistributionType.DEFAULT)
7781
.keystore(clientPrefix + "access_key", System.getProperty("s3AccessKey"))
7882
.keystore(clientPrefix + "secret_key", System.getProperty("s3SecretKey"))
79-
.setting(clientPrefix + "protocol", () -> "http", (n) -> enabled)
80-
.setting(clientPrefix + "region", regionSupplier, (n) -> enabled)
83+
.setting(clientPrefix + "protocol", () -> "http", n -> USE_FIXTURE)
84+
.setting(clientPrefix + "region", regionSupplier, n -> USE_FIXTURE)
8185
.setting(clientPrefix + "add_purpose_custom_query_parameter", () -> randomFrom("true", "false"), n -> randomBoolean())
82-
.setting(clientPrefix + "endpoint", s3HttpFixture::getAddress, (n) -> enabled)
86+
.setting(clientPrefix + "endpoint", s3HttpFixture::getAddress, n -> USE_FIXTURE)
8387
.setting(
8488
"repository_s3.compare_and_exchange.anti_contention_delay",
8589
() -> randomFrom("1s" /* == default */, "1ms"),

x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisRestIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@
88

99
import fixture.s3.S3HttpFixture;
1010

11-
import org.elasticsearch.core.Booleans;
1211
import org.elasticsearch.test.cluster.ElasticsearchCluster;
1312
import org.junit.ClassRule;
1413
import org.junit.rules.RuleChain;
1514
import org.junit.rules.TestRule;
1615

1716
public class S3RepositoryAnalysisRestIT extends AbstractS3RepositoryAnalysisRestTestCase {
1817

19-
static final boolean USE_FIXTURE = Booleans.parseBoolean(System.getProperty("tests.use.fixture", "true"));
18+
public static final S3HttpFixture s3Fixture = new RepositoryAnalysisHttpFixture();
2019

21-
public static final S3HttpFixture s3Fixture = new RepositoryAnalysisHttpFixture(USE_FIXTURE);
22-
23-
public static final ElasticsearchCluster cluster = buildCluster(s3Fixture, USE_FIXTURE);
20+
public static final ElasticsearchCluster cluster = buildCluster(s3Fixture);
2421

2522
@ClassRule
2623
public static TestRule ruleChain = RuleChain.outerRule(s3Fixture).around(cluster);

x-pack/plugin/snapshot-repo-test-kit/qa/s3/src/javaRestTest/java/org/elasticsearch/repositories/blobstore/testkit/analyze/S3RepositoryAnalysisStrongMpusRestIT.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
public class S3RepositoryAnalysisStrongMpusRestIT extends AbstractS3RepositoryAnalysisRestTestCase {
1919

20-
public static final S3HttpFixture s3Fixture = new RepositoryAnalysisHttpFixture(true) {
20+
public static final S3HttpFixture s3Fixture = new RepositoryAnalysisHttpFixture() {
2121
@Override
2222
protected S3ConsistencyModel consistencyModel() {
2323
return S3ConsistencyModel.STRONG_MPUS;
2424
}
2525
};
2626

27-
public static final ElasticsearchCluster cluster = buildCluster(s3Fixture, true);
27+
public static final ElasticsearchCluster cluster = buildCluster(s3Fixture);
2828

2929
@ClassRule
3030
public static TestRule ruleChain = RuleChain.outerRule(s3Fixture).around(cluster);
@@ -34,4 +34,10 @@ protected String getTestRestCluster() {
3434
return cluster.getHttpAddresses();
3535
}
3636

37+
@Override
38+
public void testRepositoryAnalysis() throws Exception {
39+
if (USE_FIXTURE) {
40+
super.testRepositoryAnalysis();
41+
} // else we're running against a real AWS S3 which has a different consistency model, so this test isn't meaningful
42+
}
3743
}

0 commit comments

Comments
 (0)