Browse Source

Allow more time for a unit-test when running on slow Gump VM

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1766397 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_16_BETA1
Dominik Stadler 7 years ago
parent
commit
18e02b0618

+ 1
- 0
build.xml View File

@@ -300,6 +300,7 @@ under the License.
<propertyref name="javax.xml.stream.XMLInputFactory"/>
<propertyref name="org.apache.commons.logging.Log"/>
<propertyref name="java.locale.providers"/> <!-- required for Java 9 compilation -->
<propertyref name="version.id"/> <!-- to detect if we are running on slow Gump VM -->
</propertyset>

<!-- this can be overwriten to empty when running with Java 9 -->

+ 10
- 2
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java View File

@@ -41,9 +41,17 @@ public class TestXSSFSheetMergeRegions {
}
System.out.println("Retry " + i + " because run-time is too high: " + millis);
}

boolean inGump = false;
String version = System.getProperty("version.id");
if(version != null && version.startsWith("gump-")) {
inGump = true;
}

// This time is typically ~800ms, versus ~7800ms to iterate getMergedRegion(int).
assertTrue("Should have taken <2000 ms to iterate 50k merged regions but took " + millis, millis < 2000);
// when running in Gump, the VM is very slow, so we should allow much more time
assertTrue("Should have taken <2000 ms to iterate 50k merged regions but took " + millis,
inGump ? millis < 8000 : millis < 2000);
} finally {
wb.close();
}

Loading…
Cancel
Save