Skip to content

Commit

Permalink
Do not reuse surefire (failsafe) forks
Browse files Browse the repository at this point in the history
Reusing forks is a cause of flakyness in tests, especially ones with
JenkinsRules, as Jenkins iteslf has many things static that may get left
in a zombie like state in between tests.

At the same time update the surefire systemProperty configuration to the
non deprecated systemPropertyVariables and move the headless propery
defintion there.
  • Loading branch information
jtnord committed Nov 8, 2021
1 parent 388cbcf commit bc28ac6
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<releaseProfiles> </releaseProfiles>
<arguments> </arguments>
<argLine>-Xms768M -Xmx768M -Djava.awt.headless=true -XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>
<argLine>-Xms768M -Xmx768M -XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine>

<jenkins.version>2.204</jenkins.version>
<jenkins-bom.version>${jenkins.version}</jenkins-bom.version>
Expand Down Expand Up @@ -731,35 +731,27 @@
<configuration>
<!-- SUREFIRE-1226 workaround -->
<trimStackTrace>false</trimStackTrace>
<systemProperties>
<property>
<name>hudson.udp</name>
<value>-1</value>
</property>
<property>
<name>java.io.tmpdir</name>
<value>${surefireTempDir}</value>
</property>
</systemProperties>
<systemPropertyVariables>
<hudson.udp>-1</hudson.udp>
<java.io.tmpdir>${surefireTempDir}</java.io.tmpdir>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
<runOrder>alphabetical</runOrder>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<!-- SUREFIRE-1226 workaround -->
<trimStackTrace>false</trimStackTrace>
<systemProperties>
<property>
<name>hudson.udp</name>
<value>-1</value>
</property>
<property>
<name>java.io.tmpdir</name>
<value>${surefireTempDir}</value>
</property>
</systemProperties>
<systemPropertyVariables>
<hudson.udp>-1</hudson.udp>
<java.io.tmpdir>${surefireTempDir}</java.io.tmpdir>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
<runOrder>alphabetical</runOrder>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit bc28ac6

Please sign in to comment.