This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 8e3ca1051e Made unique IT directories conditional on a system property
(#5940)
8e3ca1051e is described below
commit 8e3ca1051ef17c46e78c1e6de393c1dc82ae3af2
Author: Dave Marion <[email protected]>
AuthorDate: Tue Sep 30 11:24:57 2025 -0400
Made unique IT directories conditional on a system property (#5940)
Modified the logic added in #5676 such that the unique directory
is disabled by default and can be enabled by adding one of the
following to the Maven build command:
-Puniq-test-dirs
-Daccumulo.it.uniq.test.dir=true
Closes #5739
---
pom.xml | 13 +++++++++++++
.../java/org/apache/accumulo/harness/AccumuloITBase.java | 9 +++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7137a6b83b..d4c35cd1e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -134,6 +134,7 @@ under the License.
<!-- used for filtering the java source with the current version -->
<accumulo.build.release.version>${project.version}</accumulo.build.release.version>
<accumulo.build.unitTestMemSize>-Xmx1G</accumulo.build.unitTestMemSize>
+ <accumulo.it.uniq.test.dir>false</accumulo.it.uniq.test.dir>
<!-- avoid error shutting down built-in ForkJoinPool.commonPool() during
exec:java tasks -->
<exec.cleanupDaemonThreads>false</exec.cleanupDaemonThreads>
<failsafe.excludedGroups />
@@ -850,6 +851,7 @@ under the License.
<excludedGroups>${failsafe.excludedGroups}</excludedGroups>
<groups>${failsafe.groups}</groups>
<systemPropertyVariables combine.children="append">
+
<accumulo.it.uniq.test.dir>${accumulo.it.uniq.test.dir}</accumulo.it.uniq.test.dir>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
</systemPropertyVariables>
<argLine>${accumulo.build.extraTestArgs}</argLine>
@@ -1745,5 +1747,16 @@ under the License.
</plugins>
</build>
</profile>
+ <profile>
+ <id>uniq-test-dirs</id>
+ <activation>
+ <property>
+ <name>uniq-test-dirs</name>
+ </property>
+ </activation>
+ <properties>
+ <accumulo.it.uniq.test.dir>true</accumulo.it.uniq.test.dir>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/test/src/main/java/org/apache/accumulo/harness/AccumuloITBase.java
b/test/src/main/java/org/apache/accumulo/harness/AccumuloITBase.java
index f6d1221d64..714ab946d5 100644
--- a/test/src/main/java/org/apache/accumulo/harness/AccumuloITBase.java
+++ b/test/src/main/java/org/apache/accumulo/harness/AccumuloITBase.java
@@ -47,6 +47,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
public class AccumuloITBase extends WithTestNames {
private static final Logger log =
LoggerFactory.getLogger(AccumuloITBase.class);
+ public static final String UNIQUE_TEST_DIR_SYS_PROPERTY =
"accumulo.it.uniq.test.dir";
public static final String STANDALONE_CAPABLE_CLUSTER =
"StandaloneCapableCluster";
public static final String SUNNY_DAY = "SunnyDay";
public static final String MINI_CLUSTER_ONLY = "MiniClusterOnly";
@@ -91,8 +92,12 @@ public class AccumuloITBase extends WithTestNames {
if (name == null) {
return baseDir;
}
- String uniqueName = String.format("%s-%d-%d", name,
System.currentTimeMillis(),
- RANDOM.get().nextInt(Short.MAX_VALUE));
+
+ String uniqueName =
+ System.getProperty(UNIQUE_TEST_DIR_SYS_PROPERTY,
"").equalsIgnoreCase("true")
+ ? String.format("%s-%d-%d", name, System.currentTimeMillis(),
+ RANDOM.get().nextInt(Short.MAX_VALUE))
+ : name;
File testDir = baseDir.toPath().resolve(uniqueName).toFile();
FileUtils.deleteQuietly(testDir);
assertTrue(testDir.mkdir());