Repository: impala Updated Branches: refs/heads/master 2362b672c -> 890457c01
IMPALA-7067: deflake test_cancellation Tweak the query so that it still runs for a long time but can cancel the fragment quicker instead of being stuck in a long sleep() call. Change-Id: I0c90d4f5c277f7b0d5561637944b454f7a44c76e Reviewed-on: http://gerrit.cloudera.org:8080/10499 Reviewed-by: Tim Armstrong <[email protected]> Tested-by: Tim Armstrong <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/a7c6fa71 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/a7c6fa71 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/a7c6fa71 Branch: refs/heads/master Commit: a7c6fa71010a803b232de01c0d66798f171d3bb0 Parents: 2362b67 Author: Tim Armstrong <[email protected]> Authored: Wed May 23 21:56:14 2018 -0700 Committer: Tim Armstrong <[email protected]> Committed: Thu May 24 19:27:51 2018 +0000 ---------------------------------------------------------------------- tests/shell/test_shell_commandline.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/a7c6fa71/tests/shell/test_shell_commandline.py ---------------------------------------------------------------------- diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py index 1962e41..a3eea7f 100644 --- a/tests/shell/test_shell_commandline.py +++ b/tests/shell/test_shell_commandline.py @@ -317,9 +317,12 @@ class TestImpalaShell(ImpalaTestSuite): assert 0 == impalad_service.get_num_in_flight_queries() def test_cancellation(self): - """Test cancellation (Ctrl+C event).""" - args = '-q "select sleep(100000)"' - p = ImpalaShell(args) + """Test cancellation (Ctrl+C event). Run a query that sleeps 10ms per row so will run + for 110s if not cancelled, but will detect cancellation quickly because of the small + batch size.""" + query = "set num_nodes=1; set mt_dop=1; set batch_size=1; \ + select sleep(10) from functional_parquet.alltypesagg" + p = ImpalaShell('-q "{0}"'.format(query)) sleep(6) os.kill(p.pid(), signal.SIGINT) result = p.get_result()
