Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Upcoming (TBD)
==============

Internal:
---------
* Make the external-editor behave scenario less flaky: the ``expect_exact``
timeouts in ``tests/features/steps/iocommands.py`` were as low as 1-2
seconds, which intermittently expired on loaded CI runners and reported
``Scenario: edit sql in file with external editor`` as an error. Raised to 10
seconds; passing runs are unaffected because pexpect returns as soon as the
expected text appears.

Bug fixes:
----------
* Restore cursor shape behaviour for Emacs mode
Expand Down
20 changes: 10 additions & 10 deletions tests/features/steps/iocommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ def step_edit_file(context):
if os.path.exists(context.editor_file_name):
os.remove(context.editor_file_name)
context.cli.sendline(r"\e {}".format(os.path.basename(context.editor_file_name)))
wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=2)
wrappers.expect_exact(context, ":", timeout=2)
wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=10)
wrappers.expect_exact(context, ":", timeout=10)


@when("we type sql in the editor")
def step_edit_type_sql(context):
context.cli.sendline("i")
context.cli.sendline("select * from abc")
context.cli.sendline(".")
wrappers.expect_exact(context, ":", timeout=2)
wrappers.expect_exact(context, ":", timeout=10)


@when("we exit the editor")
def step_edit_quit(context):
context.cli.sendline("x")
wrappers.expect_exact(context, "written", timeout=2)
wrappers.expect_exact(context, "written", timeout=10)


@then("we see the sql in prompt")
def step_edit_done_sql(context):
for match in "select * from abc".split(" "):
wrappers.expect_exact(context, match, timeout=1)
wrappers.expect_exact(context, match, timeout=10)
# Cleanup the command line.
context.cli.sendcontrol("c")
# Cleanup the edited file.
Expand All @@ -48,10 +48,10 @@ def step_tee_ouptut(context):
if os.path.exists(context.tee_file_name):
os.remove(context.tee_file_name)
context.cli.sendline(r"\o {}".format(os.path.basename(context.tee_file_name)))
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5)
wrappers.expect_exact(context, "Writing to file", timeout=5)
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5)
wrappers.expect_exact(context, "Time", timeout=5)
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=10)
wrappers.expect_exact(context, "Writing to file", timeout=10)
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=10)
wrappers.expect_exact(context, "Time", timeout=10)


@when('we query "select 123456"')
Expand All @@ -62,7 +62,7 @@ def step_query_select_123456(context):
@when("we stop teeing output")
def step_notee_output(context):
context.cli.sendline(r"\o")
wrappers.expect_exact(context, "Time", timeout=5)
wrappers.expect_exact(context, "Time", timeout=10)


@then("we see 123456 in tee output")
Expand Down
Loading