IMPALA-5246: Verify that a UDF test completely finishes before moving on A memory intensive UDF test takes a while to completely finish and for the memory in Impala to be completely freed. This caused a problem in ASAN builds (and potentially in normal builds) because we would start the next test right away, before the memory is freed.
We fix the issue by checking that all fragments finish executing before starting the next test. Testing: - Ran a private ASAN build which passed. Change-Id: I0555b5327945c522f70f449caa1214ee0bfd84fe Reviewed-on: http://gerrit.cloudera.org:8080/6893 Reviewed-by: Alex Behm <[email protected]> Reviewed-by: Michael Ho <[email protected]> Tested-by: Impala Public 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/b73c445e Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/b73c445e Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/b73c445e Branch: refs/heads/master Commit: b73c445eba48a4637c5642fa1866e237617a322d Parents: 5905083 Author: Taras Bobrovytsky <[email protected]> Authored: Thu May 11 13:54:13 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Wed May 17 04:31:08 2017 +0000 ---------------------------------------------------------------------- tests/query_test/test_udfs.py | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/b73c445e/tests/query_test/test_udfs.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_udfs.py b/tests/query_test/test_udfs.py index ec24c9f..e8e4ead 100644 --- a/tests/query_test/test_udfs.py +++ b/tests/query_test/test_udfs.py @@ -30,6 +30,7 @@ from tests.common.test_dimensions import ( create_uncompressed_text_dimension) from tests.util.calculation_util import get_random_id from tests.util.filesystem_utils import get_fs_path, IS_S3 +from tests.verifiers.metric_verifier import MetricVerifier class TestUdfBase(ImpalaTestSuite): """ @@ -341,6 +342,14 @@ class TestUdfExecution(TestUdfBase): except ImpalaBeeswaxException, e: self._check_exception(e) + # It takes a long time for Impala to free up memory after this test, especially if + # ASAN is enabled. Verify that all fragments finish executing before moving on to the + # next test to make sure that the next test is not affected. + for impalad in ImpalaCluster().impalads: + verifier = MetricVerifier(impalad.service) + verifier.wait_for_metric("impala-server.num-fragments-in-flight", 0) + verifier.verify_num_unused_buffers() + def test_udf_constant_folding(self, vector, unique_database): """Test that constant folding of UDFs is handled correctly. Uses count_rows(), which returns a unique value every time it is evaluated in the same thread."""
