This is an archive of the discontinued LLVM Phabricator instance.

[pexepect] Add a small sleep between pexect calls
AbandonedPublic

Authored by JDevlieghere on Apr 11 2019, 4:32 AM.

Details

Reviewers
labath
davide
Summary

When we upgraded pexpect to a more recent version, we experienced issues where pexpect was sending commands faster to LLDB could process. The problem was especially apparent on CI systems, where the high load caused LLDB to be inevitable more constrained. Usually the issue would go away when running the test by itself and would reappear when running multiple tests concurrently.

When we looked at this, the pexecpt implementation already contains a small timeout. Apparently that sometimes wasn't sufficient for LLDB.

Rather than adding timeouts in the affected tests, I would propose to just do it in lldbpexpect.py. It's definitely not the best solution, but it does solve the flakiness issues I'm investigating.

Diff Detail

Event Timeline

JDevlieghere created this revision.Apr 11 2019, 4:32 AM
Herald added a project: Restricted Project. ยท View Herald TranscriptApr 11 2019, 4:32 AM

To give a little more context: the particular issue I was looking at (TestCommandScriptImmediateOutput) occurs with sendline. We send a bunch of commands and always check for the prompt. I can reproduce the error when piping the test commands directly to LLDB.

JDevlieghere abandoned this revision.Apr 11 2019, 5:52 AM

Apparently Pavel already investigated and fixed this in r357459. We also discussed a better way to make this work by checking the echo of the command passed to sendline.