Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 01808200B17 for ; Tue, 21 Jun 2016 16:32:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 000E3160A4F; Tue, 21 Jun 2016 14:32:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 475EE160A07 for ; Tue, 21 Jun 2016 16:32:42 +0200 (CEST) Received: (qmail 24382 invoked by uid 500); 21 Jun 2016 14:32:41 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 24372 invoked by uid 99); 21 Jun 2016 14:32:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2016 14:32:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 32E25E020A; Tue, 21 Jun 2016 14:32:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tedyu@apache.org To: commits@hbase.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-16051 TestScannerHeartbeatMessages fails on some machines (Phil Yang) Date: Tue, 21 Jun 2016 14:32:41 +0000 (UTC) archived-at: Tue, 21 Jun 2016 14:32:43 -0000 Repository: hbase Updated Branches: refs/heads/master 471f942ec -> b006e41a3 HBASE-16051 TestScannerHeartbeatMessages fails on some machines (Phil Yang) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/b006e41a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b006e41a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b006e41a Branch: refs/heads/master Commit: b006e41a37de7f87b91d73407978f6b09b12a15b Parents: 471f942 Author: tedyu Authored: Tue Jun 21 07:32:30 2016 -0700 Committer: tedyu Committed: Tue Jun 21 07:32:30 2016 -0700 ---------------------------------------------------------------------- .../TestScannerHeartbeatMessages.java | 26 +++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/b006e41a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java index a958ee0..54bee94 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerHeartbeatMessages.java @@ -92,7 +92,7 @@ public class TestScannerHeartbeatMessages { private static byte[] ROW = Bytes.toBytes("testRow"); private static byte[][] ROWS = HTestConst.makeNAscii(ROW, NUM_ROWS); - private static int NUM_FAMILIES = 3; + private static int NUM_FAMILIES = 4; private static byte[] FAMILY = Bytes.toBytes("testFamily"); private static byte[][] FAMILIES = HTestConst.makeNAscii(FAMILY, NUM_FAMILIES); @@ -103,19 +103,23 @@ public class TestScannerHeartbeatMessages { private static int VALUE_SIZE = 128; private static byte[] VALUE = Bytes.createMaxByteArray(VALUE_SIZE); - - private static int SERVER_TIMEOUT = 6000; + // The time limit should be based on the rpc timeout at client, or the client will regards + // the request as timeout before server return a heartbeat. + private static int SERVER_TIMEOUT = 60000; // Time, in milliseconds, that the client will wait for a response from the server before timing // out. This value is used server side to determine when it is necessary to send a heartbeat - // message to the client - private static int CLIENT_TIMEOUT = SERVER_TIMEOUT / 3; - - // By default, at most one row's worth of cells will be retrieved before the time limit is reached - private static int DEFAULT_ROW_SLEEP_TIME = CLIENT_TIMEOUT / 5; - // By default, at most cells for two column families are retrieved before the time limit is - // reached - private static int DEFAULT_CF_SLEEP_TIME = DEFAULT_ROW_SLEEP_TIME / NUM_FAMILIES; + // message to the client. Time limit will be 500 ms. + private static int CLIENT_TIMEOUT = 1000; + + // In this test, we sleep after reading each row. So we should make sure after we get some number + // of rows and sleep same times we must reach time limit, and do not timeout after next sleeping. + // So set this to 200, we will get 3 rows and reach time limit at the start of 4th row, then sleep + // for the 4th time. Total time is 800 ms so we will not timeout. + private static int DEFAULT_ROW_SLEEP_TIME = 200; + + // Similar with row sleep time. + private static int DEFAULT_CF_SLEEP_TIME = 200; @BeforeClass public static void setUpBeforeClass() throws Exception {