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.