IMPALA-3488: test_ddl.py failure on LocalFS run Our test_ddl.py always had a bug where in the _cleanup() function, we used the hdfs_client on local FS runs. It always ended up passing because we caught generic exceptions in hdfs_client.delete_file_dir() while checking if a file existed which always caused the test to pass.
With the introduction of an hdfs_client.exists() function in IMPALA-1878 which catches only the right FileNotFound exception, this bug was exposed causing our local FS runs to fail. This patch returns from the _cleanup() function if it's a local FS run because the directories of the tables it cleans up are not used in these runs. Change-Id: Ie0c9eec31a90e8f66102d18d900c613bd1306968 Reviewed-on: http://gerrit.cloudera.org:8080/2980 Reviewed-by: Alex Behm <[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/41e31439 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/41e31439 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/41e31439 Branch: refs/heads/master Commit: 41e31439d331df7cb2921a31e8290b52b5e2581d Parents: 2bb98a0 Author: Sailesh Mukil <[email protected]> Authored: Thu May 5 22:59:44 2016 -0700 Committer: Tim Armstrong <[email protected]> Committed: Thu May 12 14:17:57 2016 -0700 ---------------------------------------------------------------------- tests/metadata/test_ddl.py | 1 + 1 file changed, 1 insertion(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/41e31439/tests/metadata/test_ddl.py ---------------------------------------------------------------------- diff --git a/tests/metadata/test_ddl.py b/tests/metadata/test_ddl.py index d40f77c..f170c06 100644 --- a/tests/metadata/test_ddl.py +++ b/tests/metadata/test_ddl.py @@ -61,6 +61,7 @@ class TestDdlStatements(ImpalaTestSuite): def _cleanup(self): map(self.cleanup_db, self.TEST_DBS) + if IS_LOCAL: return # Cleanup the test table HDFS dirs between test runs so there are no errors the next # time a table is created with the same location. This also helps remove any stale # data from the last test run.
