Skip to content

Commit d35b321

Browse files
HADOOP-19608. Upgrade to JUnit 5.13.3 + Surefire 3.5.3 (apache#7785)
JUnit has been upgraded to 5.13.3 so that test suites can be parameterized at the class level (again). This requires a matching upgrade to Surefire and some tuning of surefire options to restore existing behavior. Dependency Changes: * junit.jupiter and junit.vintage => 5.13.3 * junit.platform => 1.13.3 * Surefire => 3.5.3. Changed Surefire Flags: * trimStackTrace => false * surefire.failIfNoSpecifiedTests => false Build property trimStackTrace ----------------------------- trimStackTrace is set to false by default This restores the behavior that any test failure includes a deep stack trace rather than the first two elements. In this version of surefire it also seems to print the full stack of JUnit test execution and the java runtime itself. This is only an issue for when tests fail. If the short trace is desired, enable it on the command line: mvn test -DtrimStackTrace Build property surefire.failIfNoSpecifiedTests ---------------------------------------------- surefire.failIfNoSpecifiedTests is set to false by default This is required to retain the behavior where the invocation mvn verify -Dtest=unknown will skip the unit tests but still run the integration tests, and a specific property "it.test" can name the specific test to run: mvn verify -Dtest=unknown -Dit.test=ITestConnection Contributed by Steve Loughran
1 parent 648c0ef commit d35b321

File tree

4 files changed

+13
-23
lines changed

4 files changed

+13
-23
lines changed

hadoop-client-modules/hadoop-client-integration-tests/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
<goal>verify</goal>
165165
</goals>
166166
<configuration>
167-
<trimStackTrace>false</trimStackTrace>
168167
</configuration>
169168
</execution>
170169
</executions>

hadoop-project/pom.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,18 @@
187187
</extraJavaTestArgs>
188188
<!-- Plugin versions and config -->
189189
<maven-surefire-plugin.argLine>-Xmx4096m -Xss2m -XX:+HeapDumpOnOutOfMemoryError ${extraJavaTestArgs}</maven-surefire-plugin.argLine>
190-
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
190+
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
191191
<maven-surefire-report-plugin.version>${maven-surefire-plugin.version}</maven-surefire-report-plugin.version>
192192
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
193+
<!--
194+
Surefire option to not fail a build if -Dtest=NAME doesn't find a
195+
test called NAME. This is needed when running integration tests through
196+
failsafe, as setting -Dtest=none is the way to stop surefire
197+
running all unit tests before the it.test option is picked up.
198+
-->
199+
<surefire.failIfNoSpecifiedTests>false</surefire.failIfNoSpecifiedTests>
200+
<!-- Flag to stop surefire from shortening test stacks -->
201+
<trimStackTrace>false</trimStackTrace>
193202

194203
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
195204
<maven-install-plugin.version>2.5.1</maven-install-plugin.version>
@@ -225,9 +234,9 @@
225234
<sshd.version>2.11.0</sshd.version>
226235
<hbase.version>2.6.1-hadoop3</hbase.version>
227236
<junit.version>4.13.2</junit.version>
228-
<junit.jupiter.version>5.8.2</junit.jupiter.version>
229-
<junit.vintage.version>5.8.2</junit.vintage.version>
230-
<junit.platform.version>1.8.2</junit.platform.version>
237+
<junit.jupiter.version>5.13.3</junit.jupiter.version>
238+
<junit.vintage.version>5.13.3</junit.vintage.version>
239+
<junit.platform.version>1.13.3</junit.platform.version>
231240
<assertj.version>3.12.2</assertj.version>
232241
<jline.version>3.9.0</jline.version>
233242
<powermock.version>2.0.9</powermock.version>
@@ -1315,11 +1324,6 @@
13151324
<artifactId>mockito-all</artifactId>
13161325
<version>1.10.19</version>
13171326
</dependency>
1318-
<dependency>
1319-
<groupId>org.mockito</groupId>
1320-
<artifactId>mockito-junit-jupiter</artifactId>
1321-
<version>3.12.4</version>
1322-
</dependency>
13231327
<dependency>
13241328
<groupId>org.objenesis</groupId>
13251329
<artifactId>objenesis</artifactId>
@@ -2498,7 +2502,6 @@
24982502
<DYLD_LIBRARY_PATH>${env.DYLD_LIBRARY_PATH}:${project.build.directory}/native/target/usr/local/lib:${hadoop.common.build.dir}/native/target/usr/local/lib</DYLD_LIBRARY_PATH>
24992503
<MALLOC_ARENA_MAX>4</MALLOC_ARENA_MAX>
25002504
</environmentVariables>
2501-
<trimStackTrace>false</trimStackTrace>
25022505
<systemPropertyVariables>
25032506

25042507
<hadoop.log.dir>${project.build.directory}/log</hadoop.log.dir>

hadoop-tools/hadoop-aws/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
<configuration>
108108
<forkCount>${testsThreadCount}</forkCount>
109109
<reuseForks>false</reuseForks>
110-
<trimStackTrace>false</trimStackTrace>
111110
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
112111
<systemPropertyVariables>
113112
<testsThreadCount>${testsThreadCount}</testsThreadCount>
@@ -141,7 +140,6 @@
141140
<reuseForks>false</reuseForks>
142141
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
143142
<forkedProcessTimeoutInSeconds>${fs.s3a.scale.test.timeout}</forkedProcessTimeoutInSeconds>
144-
<trimStackTrace>false</trimStackTrace>
145143
<systemPropertyVariables>
146144
<!-- Tell tests that they are being executed in parallel -->
147145
<test.parallel.execution>true</test.parallel.execution>
@@ -202,7 +200,6 @@
202200
</goals>
203201
<configuration>
204202
<forkedProcessTimeoutInSeconds>${fs.s3a.scale.test.timeout}</forkedProcessTimeoutInSeconds>
205-
<trimStackTrace>false</trimStackTrace>
206203
<systemPropertyVariables>
207204
<!-- Tell tests that they are being executed sequentially -->
208205
<test.parallel.execution>false</test.parallel.execution>
@@ -266,7 +263,6 @@
266263
<goal>verify</goal>
267264
</goals>
268265
<configuration>
269-
<trimStackTrace>false</trimStackTrace>
270266
<systemPropertyVariables>
271267
<!-- Propagate scale parameters -->
272268
<fs.s3a.scale.test.enabled>${fs.s3a.scale.test.enabled}</fs.s3a.scale.test.enabled>

hadoop-tools/hadoop-azure/pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@
484484
<reuseForks>false</reuseForks>
485485
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
486486
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
487-
<trimStackTrace>false</trimStackTrace>
488487
<systemPropertyVariables>
489488
<!-- Tell tests that they are being executed in parallel -->
490489
<test.parallel.execution>true</test.parallel.execution>
@@ -525,7 +524,6 @@
525524
</goals>
526525
<configuration>
527526
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
528-
<trimStackTrace>false</trimStackTrace>
529527
<systemPropertyVariables>
530528
<test.parallel.execution>false</test.parallel.execution>
531529
<fs.azure.scale.test.enabled>${fs.azure.scale.test.enabled}</fs.azure.scale.test.enabled>
@@ -619,7 +617,6 @@
619617
<threadCount>${testsThreadCount}</threadCount>
620618
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
621619
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
622-
<trimStackTrace>false</trimStackTrace>
623620
<systemPropertyVariables>
624621
<!-- Tell tests that they are being executed in parallel -->
625622
<test.parallel.execution>true</test.parallel.execution>
@@ -668,7 +665,6 @@
668665
<!--NOTICE: hadoop contract tests methods can not be ran in parallel-->
669666
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
670667
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
671-
<trimStackTrace>false</trimStackTrace>
672668
<systemPropertyVariables>
673669
<!-- Tell tests that they are being executed in parallel -->
674670
<test.parallel.execution>true</test.parallel.execution>
@@ -706,7 +702,6 @@
706702
<configuration>
707703
<!--NOTICE: hadoop contract tests methods can not be run in parallel-->
708704
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
709-
<trimStackTrace>false</trimStackTrace>
710705
<systemPropertyVariables>
711706
<!-- Tell tests that they are being executed sequentially -->
712707
<test.parallel.execution>false</test.parallel.execution>
@@ -830,7 +825,6 @@
830825
<reuseForks>false</reuseForks>
831826
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>
832827
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
833-
<trimStackTrace>false</trimStackTrace>
834828
<systemPropertyVariables>
835829
<!-- Tell tests that they are being executed in parallel -->
836830
<test.parallel.execution>true</test.parallel.execution>
@@ -893,7 +887,6 @@
893887
</goals>
894888
<configuration>
895889
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
896-
<trimStackTrace>false</trimStackTrace>
897890
<systemPropertyVariables>
898891
<test.parallel.execution>false</test.parallel.execution>
899892
<fs.azure.scale.test.enabled>${fs.azure.scale.test.enabled}</fs.azure.scale.test.enabled>
@@ -956,7 +949,6 @@
956949
<http.maxConnections>${http.maxConnections}</http.maxConnections>
957950
</systemPropertyVariables>
958951
<forkedProcessTimeoutInSeconds>${fs.azure.scale.test.timeout}</forkedProcessTimeoutInSeconds>
959-
<trimStackTrace>false</trimStackTrace>
960952
</configuration>
961953
</execution>
962954
</executions>

0 commit comments

Comments
 (0)