IMPALA-7148: Make test_profile_fragment_instances() more robust test_profile_fragment_instances() makes assumption about number of instances of each scan node in the distributed query plan. The number of instances for each scan nodes can actually vary depending on how data is loaded and scheduler's decision.
This change relaxes the check for number of instances of each scan node is a multiple of 3 which is the number of scan nodes in the plan. Change-Id: I08b068c21e9637575c85f4d54be9f7c56c106bf1 Reviewed-on: http://gerrit.cloudera.org:8080/11906 Reviewed-by: Impala Public Jenkins <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/1d412a09 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/1d412a09 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/1d412a09 Branch: refs/heads/branch-3.1.0 Commit: 1d412a09ac807c2f7ab39ac4fdc3e21c29024190 Parents: 59f3f6b Author: Michael Ho <[email protected]> Authored: Wed Nov 7 14:29:09 2018 -0800 Committer: Zoltan Borok-Nagy <[email protected]> Committed: Tue Nov 13 12:52:36 2018 +0100 ---------------------------------------------------------------------- tests/query_test/test_observability.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/1d412a09/tests/query_test/test_observability.py ---------------------------------------------------------------------- diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py index c351e02..2950ee8 100644 --- a/tests/query_test/test_observability.py +++ b/tests/query_test/test_observability.py @@ -157,9 +157,11 @@ class TestObservability(ImpalaTestSuite): with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem) select STRAIGHT_JOIN count(*) from (select * from tpch.lineitem a LIMIT 1) a join (select * from l LIMIT 2000000) b on a.l_orderkey = -b.l_orderkey;""") - # There are 3 scan nodes and each appears in the profile 4 times (for 3 fragment - # instances + the averaged fragment). - assert results.runtime_profile.count("HDFS_SCAN_NODE") == 12 + # There are 3 scan nodes and each appears in the profile n+1 times (for n fragment + # instances + the averaged fragment). n depends on how data is loaded and scheduler's + # decision. + n = results.runtime_profile.count("HDFS_SCAN_NODE") + assert n > 0 and n % 3 == 0 # There are 3 exchange nodes and each appears in the profile 2 times (for 1 fragment # instance + the averaged fragment). assert results.runtime_profile.count("EXCHANGE_NODE") == 6
