LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 23403 - Many LLDB-MI tests time out in Ubuntu 14.10 x86_64 VirtualBox VM
Summary: Many LLDB-MI tests time out in Ubuntu 14.10 x86_64 VirtualBox VM
Status: RESOLVED FIXED
Alias: None
Product: lldb
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Vadim Macagon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-03 22:26 PDT by Vadim Macagon
Modified: 2016-10-30 05:40 PDT (History)
0 users

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Macagon 2015-05-03 22:26:19 PDT
Many of the LLDB-MI tests fail due to time out when I run them from my Ubuntu 14.10 64-bit Virtualbox VM. After a bit of trial and error I realized that if a test is modified to wait for the "(gdb)" prompt after spawning the LLDB-MI child process then the test will run to completion. The test in TestMiPrompt.py is structured in this way and it was the only one I tried that didn't fail out of the box. This is what it does:

self.spawnLldbMi(args = None)

# Test that lldb-mi is ready after startup
self.expect(self.child_prompt, exactly = True)

For example, initially all tests in TestMiFile.py failed due to time outs, but after I added the line above to each one of them they ran to completion. I used this command to run the tests:

python dotest.py -A x86_64 -C clang --executable ~/Projects/llvm-build/bin/lldb tools/lldb-mi/ -t -p TestMiFile

And here's a trace from one of the failing tests in TestMiFile.py before I modified it (the rest of the tests in there failed the same way):

======================================================================
ERROR: test_lldbmi_file_exec_and_symbols_file (TestMiFile.MiFileTestCase)
   Test that 'lldb-mi --interpreter' works for -file-exec-and-symbols exe.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/enlight/Projects/llvm/tools/lldb/test/lldbtest.py", line 447, in wrapper
    return func(self, *args, **kwargs)
  File "/home/enlight/Projects/llvm/tools/lldb/test/lldbtest.py", line 562, in wrapper
    func(*args, **kwargs)
  File "/home/enlight/Projects/llvm/tools/lldb/test/tools/lldb-mi/TestMiFile.py", line 24, in test_lldbmi_file_exec_and_symbols_file
    self.expect("\^done")
  File "/home/enlight/Projects/llvm/tools/lldb/test/tools/lldb-mi/lldbmi_testcase.py", line 46, in expect
    return self.child.expect(pattern, *args, **kwargs)
  File "/home/enlight/Projects/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1316, in expect
    return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
  File "/home/enlight/Projects/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1330, in expect_list
    return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
  File "/home/enlight/Projects/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1414, in expect_loop
    raise TIMEOUT (str(e) + '\n' + str(self))
TIMEOUT: Timeout exceeded in read_nonblocking().
<pexpect.spawn object at 0x7fd76282c290>
version: 2.4 ($Revision: 516 $)
command: /home/enlight/Projects/llvm-build/bin/lldb-mi
args: ['/home/enlight/Projects/llvm-build/bin/lldb-mi', '--interpreter']
searcher: searcher_re:
    0: re.compile("\^done")
buffer (last 100 chars): -file-exec-and-symbols a.out(gdb)


before (last 100 chars): -file-exec-and-symbols a.out(gdb)


after: <class 'pexpect.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 28399
child_fd: 3
closed: False
timeout: 2
delimiter: <class 'pexpect.EOF'>
logfile: None
logfile_read: <open file 'child.log', mode 'w' at 0x7fd7621df780>
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
Config=x86_64-clang
Comment 1 Vadim Macagon 2016-10-30 05:40:02 PDT
This was fixed a year ago in https://reviews.llvm.org/D9595