IMPALA-3986: Python hive-client may fail silently while dropping partitions
It was noticed during a test run that a partition existed in the HMS when it shouldn't have. The only possible explanation for that is that the python based hive client failed to drop the partition when asked to and we did not check for an error when it did so. This patch just adds an assert to make sure that the partition is dropped when instructed to, else it will cause the test to fail in the right place. Change-Id: I4241225d19c75a79179a61fef0c75c06a9a2ac39 Reviewed-on: http://gerrit.cloudera.org:8080/4083 Reviewed-by: Matthew Jacobs <[email protected]> Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/8fb15988 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/8fb15988 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/8fb15988 Branch: refs/heads/master Commit: 8fb159889771ee81381d2aa679917fa3b6d530bd Parents: 60935a9 Author: Sailesh Mukil <[email protected]> Authored: Mon Aug 22 16:18:41 2016 -0700 Committer: Internal Jenkins <[email protected]> Committed: Tue Aug 23 09:00:06 2016 +0000 ---------------------------------------------------------------------- tests/common/impala_test_suite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8fb15988/tests/common/impala_test_suite.py ---------------------------------------------------------------------- diff --git a/tests/common/impala_test_suite.py b/tests/common/impala_test_suite.py index 4fcce64..36e7442 100644 --- a/tests/common/impala_test_suite.py +++ b/tests/common/impala_test_suite.py @@ -490,7 +490,8 @@ class ImpalaTestSuite(BaseTestSuite): def __drop_partitions(self, db_name, table_name): """Drops all partitions in the given table""" for partition in self.hive_client.get_partition_names(db_name, table_name, 0): - self.hive_client.drop_partition_by_name(db_name, table_name, partition, True) + assert self.hive_client.drop_partition_by_name(db_name, table_name, \ + partition, True), 'Could not drop partition: %s' % partition @classmethod def __execute_query(cls, impalad_client, query, query_options=None, user=None):
