<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Many LLDB-MI tests time out in Ubuntu 14.10 x86_64 VirtualBox VM"
   href="https://llvm.org/bugs/show_bug.cgi?id=23403">23403</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Many LLDB-MI tests time out in Ubuntu 14.10 x86_64 VirtualBox VM
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vadim.macagon@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>