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
This commit is contained in:
Dominik Stadler 2016-10-24 12:07:15 +00:00
parent 423a49cbab
commit a350f399f5
2 changed files with 11 additions and 2 deletions

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 -->

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();
}