cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject cassandra git commit: ninja - fix flappy unit tests in UFTest that require native protocol server socket
Date Wed, 21 Jan 2015 21:11:36 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk dfd78d0e9 -> 39108df7c


ninja - fix flappy unit tests in UFTest that require native protocol server socket


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

Branch: refs/heads/trunk
Commit: 39108df7c8e0ffae3b39ad4adfefcd18f38667f7
Parents: dfd78d0
Author: Robert Stupp <snazy@snazy.de>
Authored: Wed Jan 21 22:10:40 2015 +0100
Committer: Robert Stupp <snazy@snazy.de>
Committed: Wed Jan 21 22:10:40 2015 +0100

----------------------------------------------------------------------
 test/unit/org/apache/cassandra/cql3/CQLTester.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/39108df7/test/unit/org/apache/cassandra/cql3/CQLTester.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java b/test/unit/org/apache/cassandra/cql3/CQLTester.java
index b01ca9e..efda704 100644
--- a/test/unit/org/apache/cassandra/cql3/CQLTester.java
+++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java
@@ -18,7 +18,6 @@
 package org.apache.cassandra.cql3;
 
 import java.io.File;
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.InetAddress;
@@ -89,10 +88,13 @@ public abstract class CQLTester
 
         try
         {
-            ServerSocket serverSocket = new ServerSocket(0);
-            nativePort = serverSocket.getLocalPort();
+            try (ServerSocket serverSocket = new ServerSocket(0))
+            {
+                nativePort = serverSocket.getLocalPort();
+            }
+            Thread.sleep(250);
         }
-        catch (IOException e)
+        catch (Exception e)
         {
             throw new RuntimeException(e);
         }


Mime
View raw message