Skip to content

Commit

Permalink
IMPALA-8175: improve tests_minicluster_obj
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
  • Loading branch information
mikesbrown authored and cloudera-hudson committed Feb 9, 2019
1 parent 5429189 commit 0185b6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/comparison/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,10 @@ def web_ui_port(self):

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)

Expand Down
10 changes: 9 additions & 1 deletion tests/infra/test_stress_infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -34,6 +35,10 @@

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
Expand Down Expand Up @@ -62,10 +67,13 @@ def test_stress_finds_workloads(self, count_map):
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
Expand Down

0 comments on commit 0185b6e

Please sign in to comment.