phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [2/2] phoenix git commit: PHOENIX-2335 Fix flapping MR-related tests
Date Mon, 19 Oct 2015 03:25:00 GMT
PHOENIX-2335 Fix flapping MR-related tests


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 5188526b9d90d55116dfa6a5d42fc89c7dd57ea5
Parents: 0cdd4e9
Author: James Taylor <jtaylor@salesforce.com>
Authored: Sun Oct 18 17:05:30 2015 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Sun Oct 18 20:23:13 2015 -0700

----------------------------------------------------------------------
 .../org/apache/phoenix/end2end/ConnectionUtilIT.java | 11 +++--------
 .../apache/phoenix/mapreduce/CsvBulkLoadToolIT.java  | 15 ++++++---------
 .../org/apache/phoenix/mapreduce/IndexToolIT.java    | 13 +++++--------
 3 files changed, 14 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5188526b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionUtilIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionUtilIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionUtilIT.java
index babad81..65d2d37 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionUtilIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ConnectionUtilIT.java
@@ -19,7 +19,7 @@
 package org.apache.phoenix.end2end;
 
 import static org.apache.phoenix.query.BaseTest.setUpConfigForMiniCluster;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -32,7 +32,6 @@ import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.phoenix.jdbc.PhoenixDriver;
 import org.apache.phoenix.mapreduce.util.ConnectionUtil;
-import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -77,13 +76,9 @@ public class ConnectionUtilIT {
 	@AfterClass
 	public static void tearDownAfterClass() throws Exception {
 		try {
-			PhoenixDriver.INSTANCE.close();
+            DriverManager.deregisterDriver(PhoenixDriver.INSTANCE);
 		} finally {
-			try {
-				DriverManager.deregisterDriver(PhoenixDriver.INSTANCE);
-			} finally {
-				hbaseTestUtil.shutdownMiniCluster();
-			}
+		    hbaseTestUtil.shutdownMiniCluster();
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5188526b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
index 276bc47..e2ebad4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/CsvBulkLoadToolIT.java
@@ -62,6 +62,7 @@ public class CsvBulkLoadToolIT {
         hbaseTestUtil.startMiniMapReduceCluster();
 
         Class.forName(PhoenixDriver.class.getName());
+        DriverManager.registerDriver(PhoenixDriver.INSTANCE);
         zkQuorum = "localhost:" + hbaseTestUtil.getZkCluster().getClientPort();
         conn = DriverManager.getConnection(PhoenixRuntime.JDBC_PROTOCOL
                 + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum);
@@ -70,19 +71,15 @@ public class CsvBulkLoadToolIT {
     @AfterClass
     public static void tearDownAfterClass() throws Exception {
         try {
-            conn.close();
+            if (conn != null) conn.close();
         } finally {
             try {
-                PhoenixDriver.INSTANCE.close();
+                DriverManager.deregisterDriver(PhoenixDriver.INSTANCE);
             } finally {
                 try {
-                    DriverManager.deregisterDriver(PhoenixDriver.INSTANCE);
-                } finally {                    
-                    try {
-                        hbaseTestUtil.shutdownMiniMapReduceCluster();
-                    } finally {
-                        hbaseTestUtil.shutdownMiniCluster();
-                    }
+                    hbaseTestUtil.shutdownMiniMapReduceCluster();
+                } finally {
+                    hbaseTestUtil.shutdownMiniCluster();
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5188526b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/IndexToolIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/IndexToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/IndexToolIT.java
index bc85c6a..30cae36 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/IndexToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/mapreduce/IndexToolIT.java
@@ -67,6 +67,7 @@ public class IndexToolIT {
         hbaseTestUtil.startMiniCluster();
         hbaseTestUtil.startMiniMapReduceCluster();
         Class.forName(PhoenixDriver.class.getName());
+        DriverManager.registerDriver(PhoenixDriver.INSTANCE);
         zkQuorum = "localhost:" + hbaseTestUtil.getZkCluster().getClientPort();
     }
     
@@ -321,16 +322,12 @@ public class IndexToolIT {
     @AfterClass
     public static void tearDownAfterClass() throws Exception {
         try {
-            PhoenixDriver.INSTANCE.close();
+            DriverManager.deregisterDriver(PhoenixDriver.INSTANCE);
         } finally {
             try {
-                DriverManager.deregisterDriver(PhoenixDriver.INSTANCE);
-            } finally {                    
-                try {
-                    hbaseTestUtil.shutdownMiniMapReduceCluster();
-                } finally {
-                    hbaseTestUtil.shutdownMiniCluster();
-                }
+                hbaseTestUtil.shutdownMiniMapReduceCluster();
+            } finally {
+                hbaseTestUtil.shutdownMiniCluster();
             }
         }
     }


Mime
View raw message