You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/02/10 20:24:48 UTC

[impala] 02/09: IMPALA-8175: improve tests_minicluster_obj

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

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

commit df83d562e2a277c87fd603e81b66bf5fcdb1d6ea
Author: Michael Brown <mi...@apache.org>
AuthorDate: Fri Feb 8 09:05:46 2019 -0800

    IMPALA-8175: improve tests_minicluster_obj
    
    Adjust minicluster impalad pgrep detection usage to be compatible with
    CentOS 6 pgrep.  Skip the test if not in a minicluster, because the test
    will fail. Don't run the test in exhaustive: it's most important this
    test run pre-merge, which is core.
    
    I was able to use sh -c "pgrep ..." and impala-py.test to test this
    locally on CentOS 6 and Ubuntu 16.
    
    Change-Id: I558b3157bb16ef3d169c0d3e795e03700a17ffe4
    Reviewed-on: http://gerrit.cloudera.org:8080/12412
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/comparison/cluster.py      |  6 ++++--
 tests/infra/test_stress_infra.py | 10 +++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/comparison/cluster.py b/tests/comparison/cluster.py
index a2d8fc0..33f29a9 100644
--- a/tests/comparison/cluster.py
+++ b/tests/comparison/cluster.py
@@ -845,8 +845,10 @@ class MiniClusterImpalad(Impalad):
 
   def find_pid(self):
     # Need to filter results to avoid pgrep picking up its parent bash script.
-    pid = self.shell("pgrep -f -a 'impalad.*%s' | grep -v pgrep | "
-        "grep -o '^[0-9]*' || true" % self.hs2_port)
+    # Test with:
+    # sh -c "pgrep -l -f 'impala.*21050' | grep [i]mpalad | grep -o '^[0-9]*' || true"
+    pid = self.shell("pgrep -l -f 'impalad.*%s' | grep [i]mpalad | "
+                     "grep -o '^[0-9]*' || true" % self.hs2_port)
     if pid:
       return int(pid)
 
diff --git a/tests/infra/test_stress_infra.py b/tests/infra/test_stress_infra.py
index a11116f..bdbcdc7 100644
--- a/tests/infra/test_stress_infra.py
+++ b/tests/infra/test_stress_infra.py
@@ -17,13 +17,14 @@
 
 # This module attempts to enforce infrastructural assumptions that bind test tools to
 # product or other constraints. We want to stop these assumptions from breaking at
-# pre-commit time, not later.
+# pre-merge time, not later.
 
 import pytest
 
 from decimal import Decimal
 
 from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.common.skip import SkipIfBuildType
 from tests.comparison.cluster import MiniCluster
 from tests.util.parse_util import (
     EXPECTED_TPCDS_QUERIES_COUNT, EXPECTED_TPCH_NESTED_QUERIES_COUNT,
@@ -34,6 +35,10 @@ from tests.util.filesystem_utils import IS_LOCAL
 
 class TestStressInfra(ImpalaTestSuite):
 
+  @classmethod
+  def get_workload(cls):
+    return 'functional-query'
+
   def test_stress_binary_search_start_point(self):
     """
     Test that the stress test can use EXPLAIN to find the start point for its binary
@@ -62,10 +67,13 @@ class TestStressInfra(ImpalaTestSuite):
     for name in queries:
       assert name is not None
 
+  @SkipIfBuildType.remote
   def tests_minicluster_obj(self):
     """
     Test that the minicluster abstraction finds the minicluster.
     """
+    if self.exploration_strategy() == "exhaustive":
+      pytest.skip("Test does not need to run in exhaustive")
     cluster = MiniCluster()
     if IS_LOCAL:
       expected_pids = 1