Files
impala/tests/infra/test_stress_infra.py
Csaba Ringhofer f98b697c7b IMPALA-13929: Make 'functional-query' the default workload in tests
This change adds get_workload() to ImpalaTestSuite and removes it
from all test suites that already returned 'functional-query'.
get_workload() is also removed from CustomClusterTestSuite which
used to return 'tpch'.

All other changes besides impala_test_suite.py and
custom_cluster_test_suite.py are just mass removals of
get_workload() functions.

The behavior is only changed in custom cluster tests that didn't
override get_workload(). By returning 'functional-query' instead
of 'tpch', exploration_strategy() will no longer return 'core' in
'exhaustive' test runs. See IMPALA-3947 on why workload affected
exploration_strategy. An example for affected test is
TestCatalogHMSFailures which was skipped both in core and exhaustive
runs before this change.

get_workload() functions that return a different workload than
'functional-query' are not changed - it is possible that some of
these also don't handle exploration_strategy() as expected, but
individually checking these tests is out of scope in this patch.

Change-Id: I9ec6c41ffb3a30e1ea2de773626d1485c69fe115
Reviewed-on: http://gerrit.cloudera.org:8080/22726
Reviewed-by: Riza Suminto <riza.suminto@cloudera.com>
Reviewed-by: Daniel Becker <daniel.becker@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2025-04-08 07:12:55 +00:00

80 lines
3.1 KiB
Python

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# 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-merge time, not later.
from __future__ import absolute_import, division, print_function
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,
EXPECTED_TPCH_STRESS_QUERIES_COUNT, match_memory_estimate)
from tests.stress.concurrent_select import load_tpc_queries
from tests.util.filesystem_utils import IS_LOCAL
class TestStressInfra(ImpalaTestSuite):
def test_stress_binary_search_start_point(self):
"""
Test that the stress test can use EXPLAIN to find the start point for its binary
search.
"""
result = self.client.execute("explain select 1")
mem_limit, units = match_memory_estimate(result.data)
assert isinstance(units, str) and units.upper() in ('T', 'G', 'M', 'K', ''), (
'unexpected units {u} from explain memory estimation\n{output}:'.format(
u=units, output='\n'.join(result.data)))
assert Decimal(mem_limit) >= 0, (
'unexpected value from explain\n:' + '\n'.join(result.data))
@pytest.mark.parametrize(
'count_map',
[('tpcds', EXPECTED_TPCDS_QUERIES_COUNT),
('tpch_nested', EXPECTED_TPCH_NESTED_QUERIES_COUNT),
('tpch', EXPECTED_TPCH_STRESS_QUERIES_COUNT)])
def test_stress_finds_workloads(self, count_map):
"""
Test that the stress test will properly load TPC workloads.
"""
workload, count = count_map
queries = load_tpc_queries(workload)
assert count == len(queries)
for query in queries:
assert query.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
else:
expected_pids = 3
assert expected_pids == len(cluster.impala.for_each_impalad(lambda i: i.find_pid()))