Skip to content

Commit 981d93d

Browse files
committed
Update Hdfs3 fixture
- fix startup - stop failing silently - handle jarhell in shadowed commons
1 parent 1478532 commit 981d93d

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

gradle/verification-metadata.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,11 @@
939939
<sha256 value="a1e25d1b71e805233daefabba72a21566580354a192539cdab43bbf191dbf951" origin="Generated by Gradle"/>
940940
</artifact>
941941
</component>
942+
<component group="com.google.re2j" name="re2j" version="1.0">
943+
<artifact name="re2j-1.0.jar">
944+
<sha256 value="5406ddfec247c0db50a11b2fe6f4d881980fc3b2c3d03fce7b258c4b014be3e0" origin="Generated by Gradle"/>
945+
</artifact>
946+
</component>
942947
<component group="com.google.re2j" name="re2j" version="1.1">
943948
<artifact name="re2j-1.1.jar">
944949
<sha256 value="24ada84d1b5de584e3e84b06f0c7dd562cee6eafe8dea8083bd8eb123823bbe7" origin="Generated by Gradle"/>
@@ -1474,6 +1479,11 @@
14741479
<sha256 value="fd63b583fd3e8baeae22efacbd5a4f91c1fd97f56248e62e2615efa7b81daeaa" origin="Generated by Gradle"/>
14751480
</artifact>
14761481
</component>
1482+
<component group="commons-daemon" name="commons-daemon" version="1.4.0">
1483+
<artifact name="commons-daemon-1.4.0.jar">
1484+
<sha256 value="6b8e35b13f27f265fed0caa7c4ce9d13b790662af5f48cb7d41df394de759dbd" origin="Generated by Gradle"/>
1485+
</artifact>
1486+
</component>
14771487
<component group="commons-digester" name="commons-digester" version="1.8">
14781488
<artifact name="commons-digester-1.8.jar">
14791489
<sha256 value="05662373044f3dff112567b7bb5dfa1174e91e074c0c727b4412788013f49d56" origin="Generated by Gradle"/>

test/fixtures/hdfs-fixture/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ dependencies {
172172
hdfs3("commons-io:commons-io:2.8.0")
173173
hdfs3("org.apache.commons:commons-configuration2:2.1.1")
174174
hdfs3("org.apache.commons:commons-lang3:3.7")
175+
hdfs3("org.eclipse.jetty:jetty-xml:9.4.40.v20210413")
176+
hdfs3("commons-daemon:commons-daemon:1.4.0")
177+
hdfs3("com.google.protobuf:protobuf-java:4.32.0")
178+
hdfs3("com.google.re2j:re2j:1.0")
179+
hdfs3("org.apache.commons:commons-math3:3.6.1")
175180
hdfs3("org.apache.commons:commons-text:1.4")
176181
hdfs3("com.fasterxml.woodstox:woodstox-core:6.7.0")
177182
hdfs3("org.codehaus.woodstox:stax2-api:4.2.2")
@@ -194,6 +199,8 @@ tasks.named("shadowJar").configure {
194199
exclude "org.apache.hadoop.ipc.StandbyException"
195200
exclude "org.apache.hadoop.application-classloader.properties"
196201
}
202+
relocate("org.apache.commons.lang", "fixture.hdfs2.org.apache.commons.lang")
203+
relocate("org.apache.commons.io", "fixture.hdfs2.org.apache.commons.io")
197204
configurations.add(project.configurations.hdfs3)
198205
}
199206

@@ -203,6 +210,8 @@ def hdfs2Jar = tasks.register("hdfs2jar", ShadowJar) {
203210
exclude "org.apache.hadoop.ipc.StandbyException"
204211
exclude "org.apache.hadoop.application-classloader.properties"
205212
}
213+
relocate("org.apache.commons.lang", "fixture.hdfs2.org.apache.commons.lang")
214+
relocate("org.apache.commons.io", "fixture.hdfs2.org.apache.commons.io")
206215
archiveClassifier.set("hdfs2")
207216
from sourceSets.main.output
208217
configurations.add(project.configurations.hdfs2)
@@ -212,6 +221,7 @@ tasks.withType(ShadowJar).configureEach {
212221
dependencies {
213222
exclude(dependency("com.carrotsearch.randomizedtesting:randomizedtesting-runner:.*"))
214223
exclude(dependency("junit:junit:.*"))
224+
exclude(dependency("org.slf4j:slf4j-api:.*"))
215225
exclude(dependency("org.apache.httpcomponents:httpcore:.*"))
216226
exclude(dependency("org.apache.logging.log4j:log4j-1.2-api:.*"))
217227
exclude(dependency("net.java.dev.jna:jna:.*"))

test/fixtures/hdfs-fixture/src/main/java/org/elasticsearch/test/fixtures/hdfs/HdfsFixture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private void startMinHdfs() throws Exception {
199199
// If the maximum number of attempts is reached, rethrow the exception
200200
FileUtils.deleteDirectory(baseDir.toFile());
201201
if (attempt == maxAttempts) {
202-
Assume.assumeTrue("Unable to start HDFS cluster", false);
202+
throw e;
203203
}
204204
}
205205
}

x-pack/plugin/searchable-snapshots/qa/hdfs/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ apply plugin: 'elasticsearch.internal-available-ports'
1212
configurations {
1313
javaRestTestRuntimeClasspath {
1414
attributes {
15-
attribute(Attribute.of('hdfs.major.version', Integer), 2)
15+
attribute(Attribute.of('hdfs.major.version', Integer), 3)
1616
}
1717
}
1818
}
1919

2020
dependencies {
2121
clusterPlugins project(':plugins:repository-hdfs')
2222
javaRestTestImplementation(testArtifact(project(xpackModule('searchable-snapshots'))))
23-
javaRestTestCompileOnly project(path: ':test:fixtures:hdfs-fixture')
24-
javaRestTestRuntimeOnly project(path: ':test:fixtures:hdfs-fixture')
23+
javaRestTestImplementation project(path: ':test:fixtures:hdfs-fixture')
2524
javaRestTestImplementation project(':test:fixtures:krb5kdc-fixture')
2625
javaRestTestRuntimeOnly "com.google.guava:guava:16.0.1"
2726
javaRestTestRuntimeOnly "commons-cli:commons-cli:1.2"

0 commit comments

Comments
 (0)