[Lldb-commits] [lldb] r236816 - Make LLDB-MI tests wait for LLDB-MI to start up before sending any MI commands
Bruce Mitchener
bruce.mitchener at gmail.com
Fri May 8 02:28:11 PDT 2015
Author: brucem
Date: Fri May 8 04:28:11 2015
New Revision: 236816
URL: http://llvm.org/viewvc/llvm-project?rev=236816&view=rev
Log:
Make LLDB-MI tests wait for LLDB-MI to start up before sending any MI commands
Summary:
This set of changes addresses the issue I described in [[ http://llvm.org/pr23403 | Bug 23403 ]], in short most LLDB-MI tests fail unexpectedly due to timeout on my Ubuntu 14.10 x86_64 VirtualBox VM. I have no idea why the Ubuntu buildbots don't seem to suffer from this issue. This patch just makes **MiTestCaseBase.spawnLldbMi()** block until the spawned LLDB-MI child process outputs the **(gdb)** prompt, which ensures that MI commands aren't sent to the LLDB-MI child process until it's ready.
Before these changes 52 LLDB-MI tests failed unexpectedly (all but one due to timeouts), after these changes no tests fail due to timeouts. I still get one unexpected failure in **test_lldbmi_source_option_start_script_error** in **TestMiStartupOptions.py**, but that's due to a file error, that test should be skipped on Linux just like the other two //start_script// tests until the file error is fixed.
Patch from Vadim Macagon. Thanks!
Test Plan: ./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/
Reviewers: abidh, domipheus, ki.stfu
Reviewed By: ki.stfu
Subscribers: brucem, lldb-commits
Differential Revision: http://reviews.llvm.org/D9595
Modified:
lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py
lldb/trunk/test/tools/lldb-mi/data/TestMiData.py
lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py
lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
Modified: lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py?rev=236816&r1=236815&r2=236816&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiPrompt.py Fri May 8 04:28:11 2015
@@ -18,9 +18,6 @@ class MiPromptTestCase(lldbmi_testcase.M
self.spawnLldbMi(args = None)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that lldb-mi is ready after unknown command
self.runCmd("-unknown-command")
self.expect("\^error,msg=\"Driver\. Received command '-unknown-command'\. It was not handled\. Command 'unknown-command' not in Command Factory\"")
Modified: lldb/trunk/test/tools/lldb-mi/data/TestMiData.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/data/TestMiData.py?rev=236816&r1=236815&r2=236816&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/data/TestMiData.py (original)
+++ lldb/trunk/test/tools/lldb-mi/data/TestMiData.py Fri May 8 04:28:11 2015
@@ -85,7 +85,6 @@ class MiDataTestCase(lldbmi_testcase.MiT
"""Test that -data-read-memory-bytes can access local buffers."""
self.spawnLldbMi(args = None)
- self.expect(self.child_prompt, exactly = True)
# Load executable
self.runCmd('-file-exec-and-symbols %s' % self.myexe)
Modified: lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py?rev=236816&r1=236815&r2=236816&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py (original)
+++ lldb/trunk/test/tools/lldb-mi/lldbmi_testcase.py Fri May 8 04:28:11 2015
@@ -36,6 +36,8 @@ class MiTestCaseBase(Base):
self.lldbMiExec, args if args else ""))
self.child.setecho(True)
self.child.logfile_read = open(self.mylog, "w")
+ # wait until lldb-mi has started up and is ready to go
+ self.expect(self.child_prompt, exactly = True)
def runCmd(self, cmd):
self.child.sendline(cmd)
Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=236816&r1=236815&r2=236816&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py (original)
+++ lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Fri May 8 04:28:11 2015
@@ -18,9 +18,6 @@ class MiStartupOptionsTestCase(lldbmi_te
self.spawnLldbMi(args = "%s" % self.myexe)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable is loaded when file was specified
self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
self.expect("\^done")
@@ -44,9 +41,6 @@ class MiStartupOptionsTestCase(lldbmi_te
self.spawnLldbMi(args = "%s" % path)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable isn't loaded when unknown file was specified
self.expect("-file-exec-and-symbols \"%s\"" % path)
self.expect("\^error,msg=\"Command 'file-exec-and-symbols'. Target binary '%s' is invalid. error: unable to find executable for '%s'\"" % (path, path))
@@ -66,9 +60,6 @@ class MiStartupOptionsTestCase(lldbmi_te
self.spawnLldbMi(args = "%s" % path)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable is loaded when file was specified using absolute path
self.expect("-file-exec-and-symbols \"%s\"" % path)
self.expect("\^done")
@@ -92,9 +83,6 @@ class MiStartupOptionsTestCase(lldbmi_te
self.spawnLldbMi(args = "%s" % path)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable is loaded when file was specified using relative path
self.expect("-file-exec-and-symbols \"%s\"" % path)
self.expect("\^done")
@@ -118,9 +106,6 @@ class MiStartupOptionsTestCase(lldbmi_te
self.spawnLldbMi(args = "%s" % path)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable isn't loaded when file was specified using unknown path
self.expect("-file-exec-and-symbols \"%s\"" % path)
self.expect("\^error,msg=\"Command 'file-exec-and-symbols'. Target binary '%s' is invalid. error: unable to find executable for '%s'\"" % (path, path))
@@ -241,9 +226,6 @@ class MiStartupOptionsTestCase(lldbmi_te
logDirectory = "."
self.spawnLldbMi(args = "%s --log" % self.myexe)
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable is loaded when file was specified
self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
self.expect("\^done")
@@ -279,9 +261,6 @@ class MiStartupOptionsTestCase(lldbmi_te
self.spawnLldbMi(args = "%s --log --log-dir=%s" % (self.myexe,logDirectory))
- # Test that lldb-mi is ready after startup
- self.expect(self.child_prompt, exactly = True)
-
# Test that the executable is loaded when file was specified
self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
self.expect("\^done")
More information about the lldb-commits
mailing list