You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by db...@apache.org on 2023/12/13 09:58:44 UTC

(impala) branch master updated: IMPALA-12471 PART-2: Add check for mysqld socket file

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

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


The following commit(s) were added to refs/heads/master by this push:
     new aeb9a8206 IMPALA-12471 PART-2: Add check for mysqld socket file
aeb9a8206 is described below

commit aeb9a8206028b68833ce6e49421990854f0c8ba4
Author: gaurav1086 <ga...@gmail.com>
AuthorDate: Tue Dec 12 15:19:58 2023 -0800

    IMPALA-12471 PART-2: Add check for mysqld socket file
    
    This patch adds a check for the existance of mysqld.sock
    file in directory: /var/run/mysqld/ inside the mysqld
    docker container. If the file is not present then the
    test is skipped.
    
    Testing: tested manually with and without the mysqld.sock
    file.
    
    Change-Id: I393fd03fa6efd4c11781d219f66978a4f556c668
    Reviewed-on: http://gerrit.cloudera.org:8080/20780
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 testdata/bin/setup-mysql-env.sh               | 7 +++++++
 tests/custom_cluster/test_ext_data_sources.py | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/testdata/bin/setup-mysql-env.sh b/testdata/bin/setup-mysql-env.sh
index 0ab6138ed..d78f8a6e2 100755
--- a/testdata/bin/setup-mysql-env.sh
+++ b/testdata/bin/setup-mysql-env.sh
@@ -53,6 +53,13 @@ if [ $mysqld_status = "stopped" ];then
   exit 2
 fi
 
+# Check if mysqld.sock exists
+if [ $(docker exec -i mysql ls /var/run/mysqld/mysqld.sock > /dev/null 2>&1;\
+echo $?) -gt 0 ]; then
+  echo "Error: File /var/run/mysqld/mysqld.sock not found"
+  exit 30
+fi
+
 # Add permission to mysql socket file
 docker exec -i mysql chmod 777 /var/run/mysqld/mysqld.sock
 
diff --git a/tests/custom_cluster/test_ext_data_sources.py b/tests/custom_cluster/test_ext_data_sources.py
index a80b0dbf3..78f16dd75 100644
--- a/tests/custom_cluster/test_ext_data_sources.py
+++ b/tests/custom_cluster/test_ext_data_sources.py
@@ -81,6 +81,8 @@ class TestMySqlExtJdbcTables(CustomClusterTestSuite):
         pytest.skip("These tests requireadd the docker to be added to sudoer's group")
       elif e.returncode == 20:
         pytest.skip("Can't connect to local MySQL server")
+      elif e.returncode == 30:
+        pytest.skip("File /var/run/mysqld/mysqld.sock not found")
       else:
         assert False, "Failed to setup MySQL testing environment"