You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2020/09/04 00:11:39 UTC

[impala] 02/02: IMPALA-10119: Fix impala-shell history duplication test

This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 2359a1be9dc491f6c35fe3415265d4a29d6bc939
Author: Tamas Mate <tm...@cloudera.com>
AuthorDate: Tue Sep 1 09:50:44 2020 +0200

    IMPALA-10119: Fix impala-shell history duplication test
    
    The flaky test was
    TestImpalaShellInteractive.test_history_does_not_duplicate_on_interrupt
    
    The test failed with timeout error when the interrupt signal arrived
    later after the next test query was started. The impala-shell output was
    ^C instead of the expected query result.
    
    This change adds an additional blocking expect call to wait for the
    interrupt signal to arrive before sending in the next query.
    
    Change-Id: I242eb47cc8093c4566de206f46b75b3feab1183c
    Reviewed-on: http://gerrit.cloudera.org:8080/16391
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Tim Armstrong <ta...@cloudera.com>
---
 tests/shell/test_shell_interactive.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/shell/test_shell_interactive.py b/tests/shell/test_shell_interactive.py
index f9668d6..c6fe7e0 100755
--- a/tests/shell/test_shell_interactive.py
+++ b/tests/shell/test_shell_interactive.py
@@ -516,24 +516,27 @@ class TestImpalaShellInteractive(ImpalaTestSuite):
     # readline gets its input from tty, so using stdin does not work.
     shell_cmd = get_shell_cmd(vector)
     child_proc = spawn_shell(shell_cmd)
-    # set up history
+
+    # initialize history
     child_proc.expect(PROMPT_REGEX)
     child_proc.sendline("select 1;")
     child_proc.expect("Fetched 1 row\(s\) in [0-9]+\.?[0-9]*s")
     child_proc.expect(PROMPT_REGEX)
     child_proc.sendline("quit;")
     child_proc.wait()
+
+    # create a new shell and send SIGINT
     child_proc = spawn_shell(shell_cmd)
     child_proc.expect(PROMPT_REGEX)
-
-    # send SIGINT then quit to save history
     child_proc.sendintr()
+    child_proc.expect("\^C")
     child_proc.sendline("select 2;")
     child_proc.expect("Fetched 1 row\(s\) in [0-9]+\.?[0-9]*s")
+    child_proc.expect(PROMPT_REGEX)
     child_proc.sendline("quit;")
     child_proc.wait()
 
-    # check history in a new instance
+    # check history in a new shell instance
     p = ImpalaShell(vector)
     p.send_cmd('history')
     result = p.get_result().stderr.splitlines()