You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2018/12/10 23:44:05 UTC

[8/8] impala git commit: IMPALA-7945: Fix test_hdfs_timeout.py on python 2.6

IMPALA-7945: Fix test_hdfs_timeout.py on python 2.6

test_hdfs_timeout.py used subprocess.check_output. This function
does not exist on python 2.6; it was introduced in python 2.7.

This switches test_hdfs_timeout.py to use exec_process() from
tests.util.shell_util.

Change-Id: Ifde02778dfe74c5e7f56c6ae08cd0114bc3d3dca
Reviewed-on: http://gerrit.cloudera.org:8080/12059
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/ecf12bec
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/ecf12bec
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/ecf12bec

Branch: refs/heads/master
Commit: ecf12bec42e11262b88dc0993e375fe4d8acaafb
Parents: 24445d5
Author: Joe McDonnell <jo...@cloudera.com>
Authored: Sun Dec 9 17:28:05 2018 -0800
Committer: Joe McDonnell <jo...@cloudera.com>
Committed: Mon Dec 10 23:43:22 2018 +0000

----------------------------------------------------------------------
 tests/custom_cluster/test_hdfs_timeout.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/ecf12bec/tests/custom_cluster/test_hdfs_timeout.py
----------------------------------------------------------------------
diff --git a/tests/custom_cluster/test_hdfs_timeout.py b/tests/custom_cluster/test_hdfs_timeout.py
index a20285a..97e0aa3 100644
--- a/tests/custom_cluster/test_hdfs_timeout.py
+++ b/tests/custom_cluster/test_hdfs_timeout.py
@@ -21,7 +21,8 @@ import time
 
 from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
 from tests.common.skip import SkipIfNotHdfsMinicluster
-from subprocess import check_call, check_output
+from subprocess import check_call
+from tests.util.shell_util import exec_process
 
 
 @SkipIfNotHdfsMinicluster.tuned_for_minicluster
@@ -42,7 +43,9 @@ class TestHdfsTimeouts(CustomClusterTestSuite):
 
     # Find the NameNode's pid via pgrep. This would raise an error if it did not
     # find a pid, so there is at least one match.
-    pgrep_output = check_output(["pgrep", "-f", "namenode.NameNode"])
+    rc, pgrep_output, stderr = exec_process("pgrep -f namenode.NameNode")
+    assert rc == 0, \
+        "Error finding NameNode pid\nstdout={0}\nstderr={1}".format(pgrep_output, stderr)
     # In our test environment, this should only match one pid
     assert(pgrep_output.count("\n") == 1)
     namenode_pid = pgrep_output.strip()