]> source.dussan.org Git - poi.git/commitdiff
Allow more time for a unit-test when running on slow Gump VM
authorDominik Stadler <centic@apache.org>
Mon, 24 Oct 2016 12:07:15 +0000 (12:07 +0000)
committerDominik Stadler <centic@apache.org>
Mon, 24 Oct 2016 12:07:15 +0000 (12:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1766397 13f79535-47bb-0310-9956-ffa450edef68

build.xml
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java

index bdf0033f36244c3b9bc863defee0b27ef673e930..531ce6a3097dc1d86a6c2123239aa5a1936ec1f8 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -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 -->
index 88530dc033ca783dc39f1e1a7207b679f21ba9d4..fb7a9c0b013706a1067c6fce45200769b73466a8 100644 (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();
         }