Skip to content

Apache Lucene open-source search software

take 2: only report environment info once, even if multiple methods fail

Robert Muire3a854a1a37b
diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
index ea2751406ee..80d99537fe4 100644
--- a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
@@ -390,6 +390,16 @@ public abstract class LuceneTestCase extends Assert {
if (testsFailed) {
System.err.println("NOTE: all tests run in this JVM:");
System.err.println(Arrays.toString(testClassesRun.toArray()));
+ System.err.println("NOTE: " + System.getProperty("os.name") + " "
+ + System.getProperty("os.version") + " "
+ + System.getProperty("os.arch") + "/"
+ + System.getProperty("java.vendor") + " "
+ + System.getProperty("java.version") + " "
+ + (Constants.JRE_IS_64BIT ? "(64-bit)" : "(32-bit)") + "/"
+ + "cpus=" + Runtime.getRuntime().availableProcessors() + ","
+ + "threads=" + Thread.activeCount() + ","
+ + "free=" + Runtime.getRuntime().freeMemory() + ","
+ + "total=" + Runtime.getRuntime().totalMemory());
}
}
@@ -1014,16 +1024,6 @@ public abstract class LuceneTestCase extends Assert {
System.err.println("NOTE: reproduce with: ant test -Dtestcase=" + getClass().getSimpleName()
+ " -Dtestmethod=" + getName() + " -Dtests.seed=" + new TwoLongs(staticSeed, seed)
+ reproduceWithExtraParams());
- System.err.println("NOTE: " + System.getProperty("os.name") + " "
- + System.getProperty("os.version") + " "
- + System.getProperty("os.arch") + "/"
- + System.getProperty("java.vendor") + " "
- + System.getProperty("java.version") + " "
- + (Constants.JRE_IS_64BIT ? "(64-bit)" : "(32-bit)") + "/"
- + "cpus=" + Runtime.getRuntime().availableProcessors() + ","
- + "threads=" + Thread.activeCount() + ","
- + "free=" + Runtime.getRuntime().freeMemory() + ","
- + "total=" + Runtime.getRuntime().totalMemory());
}
// extra params that were overridden needed to reproduce the command