Repository: impala Updated Branches: refs/heads/master e9535bc02 -> 20c161d75
IMPALA-6740: Fix flaky test_cancellation test_shall_commandline:test_cancellation starts an Impala shell process, runs a query, sleeps briefly, and then cancels the query by sending a SIGINT to the process. This has been occasionally failing with either the error 'KeyboardInterrupt' or with the query succeeding instead of being cancelled. The problem occurs if the process hasn't fully started up before the SIGINT is sent - in particular, if ImpalaShell:__init__ hasn't installed the signal handler, which happens sometimes depending on concurrent load on the machine. Depending on the exact timing, this may cause a 'KeyboardInterrupt' that isn't handled, or the signal may be ignored and the query allowed to run to completion. The solution is to increase the time spent sleeping. Testing: - I can reliably repro the problem locally by reducing the sleep time. Change-Id: I5d13de6207807e4ba2e2e406a29d670f01d6c3a0 Reviewed-on: http://gerrit.cloudera.org:8080/10177 Reviewed-by: Thomas Tauber-Marshall <[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/20c161d7 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/20c161d7 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/20c161d7 Branch: refs/heads/master Commit: 20c161d7583ee1b4fc0dac3c76a7c067badfcdb2 Parents: e9535bc Author: Thomas Tauber-Marshall <[email protected]> Authored: Tue Apr 24 12:23:23 2018 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Wed Apr 25 01:25:33 2018 +0000 ---------------------------------------------------------------------- tests/shell/test_shell_commandline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/20c161d7/tests/shell/test_shell_commandline.py ---------------------------------------------------------------------- diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py index 4db71f7..1962e41 100644 --- a/tests/shell/test_shell_commandline.py +++ b/tests/shell/test_shell_commandline.py @@ -318,9 +318,9 @@ class TestImpalaShell(ImpalaTestSuite): def test_cancellation(self): """Test cancellation (Ctrl+C event).""" - args = '-q "select sleep(10000)"' + args = '-q "select sleep(100000)"' p = ImpalaShell(args) - sleep(3) + sleep(6) os.kill(p.pid(), signal.SIGINT) result = p.get_result()
