sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject incubator-sentry git commit: SENTRY-1157: Fix Unit Tests TestAclsCrud&TestAuthorize failed (Dapeng Sun, reviewed by Colin Ma)
Date Tue, 22 Mar 2016 10:42:02 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/master 5720b64d2 -> 4643f988a


SENTRY-1157: Fix Unit Tests TestAclsCrud&TestAuthorize failed (Dapeng Sun, reviewed by
Colin Ma)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/4643f988
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/4643f988
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/4643f988

Branch: refs/heads/master
Commit: 4643f988a5e0ce2b9749e6365edea3a16482de86
Parents: 5720b64
Author: Sun Dapeng <sdp@apache.org>
Authored: Tue Mar 22 18:40:15 2016 +0800
Committer: Sun Dapeng <sdp@apache.org>
Committed: Tue Mar 22 18:40:15 2016 +0800

----------------------------------------------------------------------
 .../java/org/apache/sentry/tests/e2e/kafka/KafkaTestServer.java  | 4 ++--
 .../main/java/org/apache/sentry/tests/e2e/kafka/TestUtils.java   | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4643f988/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/KafkaTestServer.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/KafkaTestServer.java
b/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/KafkaTestServer.java
index 85e7d21..2a3b317 100644
--- a/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/KafkaTestServer.java
+++ b/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/KafkaTestServer.java
@@ -39,10 +39,10 @@ public class KafkaTestServer {
     private File sentrySitePath = null;
 
     public KafkaTestServer(File sentrySitePath) throws Exception {
-        this.zkPort = TestUtils.getFreePort();
-        this.kafkaPort = TestUtils.getFreePort();
         this.sentrySitePath = sentrySitePath;
+        this.zkPort = TestUtils.getFreePort();
         createZkServer();
+        this.kafkaPort = TestUtils.getFreePort();
         createKafkaServer();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/4643f988/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/TestUtils.java
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/TestUtils.java
b/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/TestUtils.java
index dda4047..5d36082 100644
--- a/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/TestUtils.java
+++ b/sentry-tests/sentry-tests-kafka/src/main/java/org/apache/sentry/tests/e2e/kafka/TestUtils.java
@@ -23,7 +23,9 @@ public class TestUtils {
     public static int getFreePort() throws IOException {
         synchronized (TestUtils.class) {
             ServerSocket serverSocket = new ServerSocket(0);
-            return serverSocket.getLocalPort();
+            int port = serverSocket.getLocalPort();
+            serverSocket.close();
+            return port;
         }
     }
 }


Mime
View raw message