Skip to content

Commit 2371078

Browse files
authored
Raise the external-editor behave timeouts to reduce flakiness (#1619)
The `edit sql in file with external editor` scenario intermittently errors on CI: `expect_exact` waits only 2 seconds for the ex-mode banner (and 1 second per token when checking the resulting prompt), which is not always enough on a loaded runner. behave then reports the scenario as an error and fail-fast cancels the sibling matrix jobs, which looks like a systematic breakage. Raise the timeouts in tests/features/steps/iocommands.py to 10 seconds. This does not slow down passing runs: pexpect returns as soon as the expected text appears, so the timeout only bounds how long a failing wait blocks. Co-authored-by: Diego <DiegoDAF@users.noreply.github.com>
1 parent 787a77a commit 2371078

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

changelog.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
4.6.0 (2026-08-26)
22
==================
33

4+
Internal:
5+
---------
6+
* Make the external-editor behave scenario less flaky: the ``expect_exact``
7+
timeouts in ``tests/features/steps/iocommands.py`` were as low as 1-2
8+
seconds, which intermittently expired on loaded CI runners and reported
9+
``Scenario: edit sql in file with external editor`` as an error. Raised to 10
10+
seconds; passing runs are unaffected because pexpect returns as soon as the
11+
expected text appears.
12+
413
Bug fixes:
514
----------
615
* Restore cursor shape behaviour for Emacs mode

tests/features/steps/iocommands.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ def step_edit_file(context):
1212
if os.path.exists(context.editor_file_name):
1313
os.remove(context.editor_file_name)
1414
context.cli.sendline(r"\e {}".format(os.path.basename(context.editor_file_name)))
15-
wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=2)
16-
wrappers.expect_exact(context, ":", timeout=2)
15+
wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=10)
16+
wrappers.expect_exact(context, ":", timeout=10)
1717

1818

1919
@when("we type sql in the editor")
2020
def step_edit_type_sql(context):
2121
context.cli.sendline("i")
2222
context.cli.sendline("select * from abc")
2323
context.cli.sendline(".")
24-
wrappers.expect_exact(context, ":", timeout=2)
24+
wrappers.expect_exact(context, ":", timeout=10)
2525

2626

2727
@when("we exit the editor")
2828
def step_edit_quit(context):
2929
context.cli.sendline("x")
30-
wrappers.expect_exact(context, "written", timeout=2)
30+
wrappers.expect_exact(context, "written", timeout=10)
3131

3232

3333
@then("we see the sql in prompt")
3434
def step_edit_done_sql(context):
3535
for match in "select * from abc".split(" "):
36-
wrappers.expect_exact(context, match, timeout=1)
36+
wrappers.expect_exact(context, match, timeout=10)
3737
# Cleanup the command line.
3838
context.cli.sendcontrol("c")
3939
# Cleanup the edited file.
@@ -48,10 +48,10 @@ def step_tee_ouptut(context):
4848
if os.path.exists(context.tee_file_name):
4949
os.remove(context.tee_file_name)
5050
context.cli.sendline(r"\o {}".format(os.path.basename(context.tee_file_name)))
51-
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5)
52-
wrappers.expect_exact(context, "Writing to file", timeout=5)
53-
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5)
54-
wrappers.expect_exact(context, "Time", timeout=5)
51+
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=10)
52+
wrappers.expect_exact(context, "Writing to file", timeout=10)
53+
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=10)
54+
wrappers.expect_exact(context, "Time", timeout=10)
5555

5656

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

6767

6868
@then("we see 123456 in tee output")

0 commit comments

Comments
 (0)