Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5DA28183FD for ; Sat, 7 Nov 2015 00:24:12 +0000 (UTC) Received: (qmail 41314 invoked by uid 500); 7 Nov 2015 00:24:11 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 41269 invoked by uid 500); 7 Nov 2015 00:24:11 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 40940 invoked by uid 99); 7 Nov 2015 00:24:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Nov 2015 00:24:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 4DF032C1F5E for ; Sat, 7 Nov 2015 00:24:11 +0000 (UTC) Date: Sat, 7 Nov 2015 00:24:11 +0000 (UTC) From: "Youngjoon Kim (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HBASE-14784) Port conflict is not resolved in HBaseTestingUtility.randomFreePort() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Youngjoon Kim created HBASE-14784: ------------------------------------- Summary: Port conflict is not resolved in HBaseTestingUtility.randomFreePort() Key: HBASE-14784 URL: https://issues.apache.org/jira/browse/HBASE-14784 Project: HBase Issue Type: Bug Components: test Affects Versions: 1.1.2 Reporter: Youngjoon Kim Assignee: Youngjoon Kim Priority: Minor If takenRandomPorts.contains(port) == true, it means port conflict, so randomFreePort() should rerun the loop. But continue statement leads to exit the loop, because port != 0. {code:title=hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java} public static int randomFreePort() { int port = 0; do { port = randomPort(); if (takenRandomPorts.contains(port)) { continue; } takenRandomPorts.add(port); ... } while (port == 0); return port; } {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)