You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2015/05/29 15:18:09 UTC
svn commit: r1682454 - in /lucene/dev/trunk:
lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
Author: markrmiller
Date: Fri May 29 13:18:09 2015
New Revision: 1682454
URL: http://svn.apache.org/r1682454
Log:
SOLR-7601: We should only check that tests have properly closed resources if the tests passed.
Speeds up test fails and cleans up Jenkin's failure reports.
Modified:
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1682454&r1=1682453&r2=1682454&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Fri May 29 13:18:09 2015
@@ -489,7 +489,7 @@ public abstract class LuceneTestCase ext
/**
* Suite failure marker (any error in the test or suite scope).
*/
- private static TestRuleMarkFailure suiteFailureMarker;
+ protected static TestRuleMarkFailure suiteFailureMarker;
/**
* Temporary files cleanup rule.
Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1682454&r1=1682453&r2=1682454&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Fri May 29 13:18:09 2015
@@ -226,13 +226,18 @@ public abstract class SolrTestCaseJ4 ext
try {
deleteCore();
resetExceptionIgnores();
- endTrackingSearchers();
- String orr = ObjectReleaseTracker.clearObjectTrackerAndCheckEmpty();
- if (!RandomizedContext.current().getTargetClass().isAnnotationPresent(SuppressObjectReleaseTracker.class)) {
- assertNull(orr, orr);
- } else {
- if (orr != null) {
- log.warn("Some resources were not closed, shutdown, or released. This has been ignored due to the SuppressObjectReleaseTracker annotation.");
+
+ if (suiteFailureMarker.wasSuccessful()) {
+ // if the tests passed, make sure everything was closed / released
+ endTrackingSearchers();
+ String orr = ObjectReleaseTracker.clearObjectTrackerAndCheckEmpty();
+ if (!RandomizedContext.current().getTargetClass().isAnnotationPresent(SuppressObjectReleaseTracker.class)) {
+ assertNull(orr, orr);
+ } else {
+ if (orr != null) {
+ log.warn(
+ "Some resources were not closed, shutdown, or released. This has been ignored due to the SuppressObjectReleaseTracker annotation.");
+ }
}
}
resetFactory();