You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ka...@apache.org on 2019/02/08 07:48:45 UTC

[phoenix] branch master updated: PHOENIX-5125 Some tests fail after PHOENIX-4009

This is an automated email from the ASF dual-hosted git repository.

karanmehta93 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
     new 08c4496  PHOENIX-5125 Some tests fail after PHOENIX-4009
08c4496 is described below

commit 08c4496addd6417f6d3c3965fd3114f791e9fd44
Author: Karan Mehta <ka...@gmail.com>
AuthorDate: Wed Feb 6 05:28:53 2019 -0800

    PHOENIX-5125 Some tests fail after PHOENIX-4009
---
 .../java/org/apache/phoenix/end2end/SpillableGroupByIT.java   | 11 ++++++++++-
 .../org/apache/phoenix/schema/stats/NoOpStatsCollectorIT.java |  4 ++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpillableGroupByIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpillableGroupByIT.java
index 3ed09c6..340760b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpillableGroupByIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SpillableGroupByIT.java
@@ -38,6 +38,7 @@ import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
+import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -174,7 +175,15 @@ public class SpillableGroupByIT extends BaseOwnClusterIT {
         stmt.execute("UPSERT INTO " + tableName + " VALUES (2, 'NAME2')");
         stmt.execute("UPSERT INTO " + tableName + " VALUES (3, 'NAME3')");
         conn.commit();
-        stmt.execute("UPDATE STATISTICS " + tableName);
+        try {
+            stmt.execute("UPDATE STATISTICS " + tableName);
+            Assert.fail("Update Statistics SQL should have failed");
+        } catch (SQLException e) {
+            Assert.assertEquals("StatsCollectionDisabledOnServerException expected",
+                    1401, e.getErrorCode());
+            Assert.assertEquals("StatsCollectionDisabledOnServerException expected",
+                    "STS01", e.getSQLState());
+        }
         ResultSet rs = stmt.executeQuery("SELECT * FROM \"SYSTEM\".STATS");
         assertFalse(rs.next());
         rs.close();
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/schema/stats/NoOpStatsCollectorIT.java b/phoenix-core/src/it/java/org/apache/phoenix/schema/stats/NoOpStatsCollectorIT.java
index 04f4143..87f58d7 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/schema/stats/NoOpStatsCollectorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/schema/stats/NoOpStatsCollectorIT.java
@@ -20,6 +20,7 @@ package org.apache.phoenix.schema.stats;
 import com.google.common.collect.Maps;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.phoenix.end2end.NeedsOwnMiniClusterTest;
 import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PropertiesUtil;
@@ -30,6 +31,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.sql.Array;
 import java.sql.Connection;
@@ -47,6 +49,7 @@ import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
  * Tests the behavior of stats collection code when stats are disabled on server side
  * explicitly using QueryServices#STATS_COLLECTION_ENABLED property
  */
+@Category(NeedsOwnMiniClusterTest.class)
 public class NoOpStatsCollectorIT extends ParallelStatsDisabledIT {
 
     private static final Log LOG = LogFactory.getLog(NoOpStatsCollectorIT.class);
@@ -90,6 +93,7 @@ public class NoOpStatsCollectorIT extends ParallelStatsDisabledIT {
         Statement stmt = conn.createStatement();
         try {
             stmt.execute(updateStatisticsSql);
+            Assert.fail("Update Statistics SQL should have failed");
         } catch (SQLException e) {
             Assert.assertEquals("StatsCollectionDisabledOnServerException expected",
                     1401, e.getErrorCode());