IMPALA-4642: Fix TestFragmentLifecycle failures; kudu test must wait Fixes test failures in TestFragmentLifecycle when it runs after TestKuduMemLimits which takes some time for all fragments to finish closing, even though the query is finished. TestFragmentLifecycle checks that there are no fragments in flight. For now, this fixes the tests by forcing TestKuduMemLimits to wait for all 'in flight' fragments to complete before continuing. We still need to understand why the KuduScanNode/KuduScanner is taking so long to Close() (see IMPALA-4654).
Change-Id: Ia655a37ff06e92cc55ba05f01d5e94fe39447c65 Reviewed-on: http://gerrit.cloudera.org:8080/5481 Reviewed-by: Sailesh Mukil <[email protected]> Reviewed-by: Henry Robinson <[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/73e41cea Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/73e41cea Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/73e41cea Branch: refs/heads/hadoop-next Commit: 73e41cea196703701d40cc67f919287fb3511b9b Parents: ffbdeda Author: Matthew Jacobs <[email protected]> Authored: Mon Dec 12 14:32:07 2016 -0800 Committer: Internal Jenkins <[email protected]> Committed: Tue Dec 13 03:12:42 2016 +0000 ---------------------------------------------------------------------- tests/query_test/test_kudu.py | 11 +++++++++++ 1 file changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/73e41cea/tests/query_test/test_kudu.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_kudu.py b/tests/query_test/test_kudu.py index 9a5bab9..17769bd 100644 --- a/tests/query_test/test_kudu.py +++ b/tests/query_test/test_kudu.py @@ -34,6 +34,8 @@ import textwrap from tests.common import KUDU_MASTER_HOSTS from tests.common.kudu_test_suite import KuduTestSuite +from tests.common.impala_cluster import ImpalaCluster +from tests.verifiers.metric_verifier import MetricVerifier LOG = logging.getLogger(__name__) @@ -614,3 +616,12 @@ class TestKuduMemLimits(KuduTestSuite): if (mem_limit > self.QUERY_MEM_LIMITS[i]): raise assert "Memory limit exceeded" in str(e) + + # IMPALA-4645: Wait for fragments to complete; in some tests KuduScanNodes took some + # time to Close() after the query returned all rows. This is necessary to ensure + # these queries do not impact other tests. + # TODO: Scan nodes shouldn't take so long to shutdown; remove when this is + # fixed (IMPALA-4654). + verifiers = [ MetricVerifier(i.service) for i in ImpalaCluster().impalads ] + for v in verifiers: + v.wait_for_metric("impala-server.num-fragments-in-flight", 0, timeout=120)
