IMPALA-13368: Fixup Redhat detection for Python >= 3.8

Python 3.8 removed the platform.linux_distribution() function which is
currently used to detect Redhat. This switches to using the 'distro'
package, which implements the same functionality across different
Python versions. Since Redhat 6 is no longer supported, this removes
the detection of Redhat 6 and associated skip logic.

Testing:
 - Ran a core job

Change-Id: I0dfaf798c0239f6068f29adbd2eafafdbbfd66c3
Reviewed-on: http://gerrit.cloudera.org:8080/22073
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Reviewed-by: Riza Suminto <riza.suminto@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Joe McDonnell
2024-09-10 12:29:06 -07:00
parent 5c02190152
commit 5b4afb4f8f
4 changed files with 7 additions and 19 deletions

View File

@@ -61,6 +61,7 @@ texttable == 0.8.3
virtualenv == 16.7.10
avro==1.10.2
thrift==0.16.0
distro==1.6.0
# Required for Kudu:
Cython == 0.29.14

View File

@@ -16,13 +16,13 @@
# under the License.
from __future__ import absolute_import, division, print_function
import distro
import json
import logging
import os
import pytest
import re
import requests
import platform
LOG = logging.getLogger('tests.common.environ')
test_start_cluster_args = os.environ.get("TEST_START_CLUSTER_ARGS", "")
@@ -48,16 +48,11 @@ if os.path.isfile(IMPALA_LOCAL_VERSION_INFO):
raise Exception("Could not find VERSION in {0}".format(IMPALA_LOCAL_VERSION_INFO))
# Check if it is Red Hat/CentOS/Rocky/AlmaLinux Linux
distribution = platform.linux_distribution()
distname = distribution[0].lower()
version = distribution[1]
IS_REDHAT_6_DERIVATIVE = False
IS_REDHAT_DERIVATIVE = False
if distname.find('centos') or distname.find('rocky') or \
distname.find('almalinux') or distname.find('red hat'):
# Python >= 3.8 removed platform.linux_distribution(). This now uses the 'distro'
# package, which provides equivalent functionality across Python versions.
if distro.id() in ['rhel', 'rocky', 'centos', 'almalinux']:
IS_REDHAT_DERIVATIVE = True
if len(re.findall('^6\.*', version)) > 0:
IS_REDHAT_6_DERIVATIVE = True
# Find the likely BuildType of the running Impala. Assume it's found through the path
# $IMPALA_HOME/be/build/latest as a fallback.

View File

@@ -26,7 +26,7 @@ from functools import partial
from tests.common.environ import (ImpalaTestClusterProperties,
IS_DOCKERIZED_TEST_CLUSTER, IS_BUGGY_EL6_KERNEL,
HIVE_MAJOR_VERSION, IS_REDHAT_6_DERIVATIVE,
HIVE_MAJOR_VERSION,
IS_APACHE_HIVE, IS_TEST_JDK,
IS_TUPLE_CACHE)
from tests.common.kudu_test_suite import get_kudu_master_flag
@@ -265,10 +265,6 @@ class SkipIfCatalogV2:
not IMPALA_TEST_CLUSTER_PROPERTIES.is_event_polling_enabled(),
reason="Test expects event polling to be enabled.")
class SkipIfOS:
redhat6 = pytest.mark.skipif(IS_REDHAT_6_DERIVATIVE,
reason="Flaky on redhat or centos 6")
class SkipIfApacheHive():
feature_not_supported = pytest.mark.skipif(IS_APACHE_HIVE,

View File

@@ -41,7 +41,7 @@ from tests.common.custom_cluster_test_suite import (
from tests.common.environ import build_flavor_timeout, ImpalaTestClusterProperties
from tests.common.impala_test_suite import ImpalaTestSuite
from tests.common.resource_pool_config import ResourcePoolConfig
from tests.common.skip import SkipIfFS, SkipIfEC, SkipIfNotHdfsMinicluster, SkipIfOS
from tests.common.skip import SkipIfFS, SkipIfEC, SkipIfNotHdfsMinicluster
from tests.common.test_dimensions import (
create_single_exec_option_dimension,
create_uncompressed_text_dimension)
@@ -2500,7 +2500,6 @@ class TestAdmissionControllerStress(TestAdmissionControllerBase):
raise thread.error
@pytest.mark.execute_serially
@SkipIfOS.redhat6
@CustomClusterTestSuite.with_args(
impalad_args=impalad_admission_ctrl_flags(max_requests=MAX_NUM_CONCURRENT_QUERIES,
max_queued=MAX_NUM_QUEUED_QUERIES, pool_max_mem=-1, queue_wait_timeout_ms=600000),
@@ -2516,7 +2515,6 @@ class TestAdmissionControllerStress(TestAdmissionControllerBase):
'mem_limit': sys.maxsize})
@pytest.mark.execute_serially
@SkipIfOS.redhat6
@CustomClusterTestSuite.with_args(
impalad_args=impalad_admission_ctrl_config_args(
fs_allocation_file="fair-scheduler-test2.xml",
@@ -2527,7 +2525,6 @@ class TestAdmissionControllerStress(TestAdmissionControllerBase):
self.run_admission_test(vector, {'request_pool': self.pool_name})
@pytest.mark.execute_serially
@SkipIfOS.redhat6
@CustomClusterTestSuite.with_args(
impalad_args=impalad_admission_ctrl_config_args(
fs_allocation_file="fair-scheduler-test2.xml",
@@ -2553,7 +2550,6 @@ class TestAdmissionControllerStress(TestAdmissionControllerBase):
return limit_metrics[0]
@pytest.mark.execute_serially
@SkipIfOS.redhat6
@CustomClusterTestSuite.with_args(
impalad_args=impalad_admission_ctrl_flags(
max_requests=MAX_NUM_CONCURRENT_QUERIES * 30, max_queued=MAX_NUM_QUEUED_QUERIES,