hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16515 AsyncProcess has incorrent count of tasks if the backoff policy is enabled - addendum fixes timeout of TestAsyncProcess#testSubmitRandomSizeRequest (Chiaping Tsai)
Date Wed, 31 Aug 2016 09:05:19 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 1da0a48f6 -> c536c8511


HBASE-16515 AsyncProcess has incorrent count of tasks if the backoff policy is enabled - addendum
fixes timeout of TestAsyncProcess#testSubmitRandomSizeRequest (Chiaping Tsai)


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

Branch: refs/heads/master
Commit: c536c85116c98c8f55c8db11ee561ec5e7ff04ed
Parents: 1da0a48
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Aug 31 02:05:12 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Aug 31 02:05:12 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/client/TestAsyncProcess.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c536c851/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
index 00f5232..bcc052d 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java
@@ -552,12 +552,12 @@ public class TestAsyncProcess {
   public void testSubmitRandomSizeRequest() throws Exception {
     Random rn = new Random();
     final long limit = 10 * 1024 * 1024;
-    for (int count = 0; count != 2; ++count) {
-      long maxHeapSizePerRequest = Math.max(1, (Math.abs(rn.nextLong()) % limit));
-      long putsHeapSize = Math.max(1, (Math.abs(rn.nextLong()) % limit));
-      LOG.info("[testSubmitRandomSizeRequest] maxHeapSizePerRequest=" + maxHeapSizePerRequest
+ ", putsHeapSize=" + putsHeapSize);
-      doSubmitRequest(maxHeapSizePerRequest, putsHeapSize);
-    }
+    final int requestCount = 1 + (int) (rn.nextDouble() * 3);
+    long putsHeapSize = Math.abs(rn.nextLong()) % limit;
+    long maxHeapSizePerRequest = putsHeapSize / requestCount;
+    LOG.info("[testSubmitRandomSizeRequest] maxHeapSizePerRequest=" + maxHeapSizePerRequest
+
+        ", putsHeapSize=" + putsHeapSize);
+    doSubmitRequest(maxHeapSizePerRequest, putsHeapSize);
   }
 
   @Test


Mime
View raw message