Repository: impala Updated Branches: refs/heads/2.x 41f1050fb -> d983bfacd
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/d983bfac Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/d983bfac Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/d983bfac Branch: refs/heads/2.x Commit: d983bfacd6c36b32a388d4c52bca75b2c13df0d3 Parents: 296c82b 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 02:10:17 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/d983bfac/tests/shell/test_shell_commandline.py ---------------------------------------------------------------------- diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py index 97f4a30..e1a4b61 100644 --- a/tests/shell/test_shell_commandline.py +++ b/tests/shell/test_shell_commandline.py @@ -319,9 +319,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()
