accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/2] git commit: ACCUMULO-2913 Include the timeout.factor in the duration given to `drain`
Date Fri, 26 Sep 2014 00:38:39 GMT
ACCUMULO-2913 Include the timeout.factor in the duration given to `drain`


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f9464475
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f9464475
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f9464475

Branch: refs/heads/master
Commit: f94644754240c7efb1bd41628b085a1667f6b293
Parents: 0ad47e2
Author: Josh Elser <elserj@apache.org>
Authored: Thu Sep 25 18:59:49 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Sep 25 20:27:55 2014 -0400

----------------------------------------------------------------------
 .../UnorderedWorkAssignerReplicationIT.java           | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f9464475/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
b/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
index 2014cd6..0fb6044 100644
--- a/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/replication/UnorderedWorkAssignerReplicationIT.java
@@ -70,10 +70,19 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacIT
{
   private static final Logger log = LoggerFactory.getLogger(UnorderedWorkAssignerReplicationIT.class);
 
   private ExecutorService executor;
+  private int timeoutFactor = 1;
 
   @Before
   public void createExecutor() {
     executor = Executors.newSingleThreadExecutor();
+
+    try {
+      timeoutFactor = Integer.parseInt(System.getProperty("timeout.factor"));
+    } catch (NumberFormatException exception) {
+      log.warn("Could not parse timeout.factor, not increasing timeout.");
+    }
+
+    Assert.assertTrue("The timeout factor must be a positive, non-zero value", timeoutFactor
> 0);
   }
 
   @After
@@ -243,11 +252,12 @@ public class UnorderedWorkAssignerReplicationIT extends ConfigurableMacIT
{
 
       });
 
+      long timeoutSeconds = timeoutFactor * 30;
       try {
-        future.get(30, TimeUnit.SECONDS);
+        future.get(timeoutSeconds, TimeUnit.SECONDS);
       } catch (TimeoutException e) {
         future.cancel(true);
-        Assert.fail("Drain did not finish within 30 seconds");
+        Assert.fail("Drain did not finish within " + timeoutSeconds + " seconds");
       }
 
       log.info("drain completed");


Mime
View raw message