Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-11-11 16:54:03 +0000
committerChristian W. Damus2014-11-11 16:57:41 +0000
commitabc6ee0bb01182db6d8788546e123fb2fff242e2 (patch)
treed8e42f9071eb5fe9bd1b13f25847103cd12d1213 /tests/junit/plugins/junit
parentdf8aab656a2bbc17d7009dfd4780d287d3b70a91 (diff)
downloadorg.eclipse.papyrus-abc6ee0bb01182db6d8788546e123fb2fff242e2.tar.gz
org.eclipse.papyrus-abc6ee0bb01182db6d8788546e123fb2fff242e2.tar.xz
org.eclipse.papyrus-abc6ee0bb01182db6d8788546e123fb2fff242e2.zip
451013: [Tests] Intermittent failure in memory leak tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=451013 Add some console logging to try to get more information about the context of the test failures. Also add the soft-reference tuning option to the command-line in the Maven test invocation to align with the workbench launch configuration.
Diffstat (limited to 'tests/junit/plugins/junit')
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java
index 3965a23ce92..82732b15950 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.framework/src/org/eclipse/papyrus/junit/framework/classification/rules/MemoryLeakRule.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 CEA and others.
+ * Copyright (c) 2014 CEA, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
+ * Christian W. Damus - bug 451013
*
*/
package org.eclipse.papyrus.junit.framework.classification.rules;
@@ -140,7 +141,11 @@ public class MemoryLeakRule extends TestWatcher {
if(!tracker.remove(ref) && !tracker.isEmpty()) {
// The remaining tracked elements are leaked
- fail("One or more objects leaked:\n" + Joiner.on('\n').join(Iterables.transform(tracker, label())));
+ final String leaks = Joiner.on('\n').join(Iterables.transform(tracker, label()));
+ if (warmingUp) {
+ System.err.printf("[MEM] Warm-up detected leaks: %s%n", leaks.replace('\n', ' '));
+ }
+ fail("One or more objects leaked:\n" + leaks);
break; // Unreachable
}
}
@@ -252,6 +257,7 @@ public class MemoryLeakRule extends TestWatcher {
// always fail, so run such a test once up-front. Call this a metahack
try {
+ System.err.printf("[MEM] Warming up test suite: %s (%s)%n", testClass.getName(), testName);
new JUnitCore().run(Request.method(testClass, testName));
} catch (Exception e) {
// Fine, so the warm-up didn't work

Back to the top