Skip to content

Commit 1e24598

Browse files
yedayakscop
authored andcommitted
test: Don't sleep before sending data to bash
pexpect has a default delay before sending data, to let applications turn off TTY echo for example, see https://pexpect.readthedocs.io/en/stable/commonissues.html?highlight=delaybeforesend#timing-issue-with-send-and-sendline We don't need this for basically all of our tests, and setting delaybeforesend to 0 makes running the unit tests around 90% faster, from 3m18s to 16s on my machine. In GHA CI, a full run moved from ~22m to ~6m
1 parent acdf6b3 commit 1e24598

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/t/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ def bash(request) -> pexpect.spawn:
272272
dimensions=(24, 240),
273273
# TODO? codec_errors="replace",
274274
)
275+
# See https://pexpect.readthedocs.io/en/stable/commonissues.html?highlight=delaybeforesend#timing-issue-with-send-and-sendline
276+
# We don't need the delay, and it makes running the tests much slower.
277+
bash.delaybeforesend = 0
275278
bash.expect_exact(PS1)
276279

277280
# Load bashrc and bash_completion

0 commit comments

Comments
 (0)