Added some delay (100 ms) after executing each 'command interpreter' command;
this seems to alleviate the intermittent failure observed while running the
whole test suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107357 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/help/TestHelp.py b/test/help/TestHelp.py
index f252498..fbfdc8c 100644
--- a/test/help/TestHelp.py
+++ b/test/help/TestHelp.py
@@ -1,6 +1,6 @@
 """Test lldb help command."""
 
-import os
+import os, time
 import lldb
 import unittest
 
@@ -13,6 +13,8 @@
         if ("LLDB_TEST" in os.environ):
             os.chdir(os.path.join(os.environ["LLDB_TEST"], "help"));
         self.dbg = lldb.SBDebugger.Create()
+        if not self.dbg.IsValid():
+            raise Exception('Invalid debugger instance')
         self.dbg.SetAsync(False)
         self.ci = self.dbg.GetCommandInterpreter()
         if not self.ci:
@@ -26,6 +28,7 @@
         """A simple test of 'help' command and its output."""
         res = lldb.SBCommandReturnObject()
         self.ci.HandleCommand("help", res)
+        time.sleep(0.1)
         self.assertTrue(res.Succeeded())
         self.assertTrue(res.GetOutput().startswith(
             'The following is a list of built-in, permanent debugger commands'))
@@ -34,8 +37,10 @@
         """Command 'set term-width 0' should not hang the help command."""
         res = lldb.SBCommandReturnObject()
         self.ci.HandleCommand("set term-width 0", res)
+        time.sleep(0.1)
         self.assertTrue(res.Succeeded())
         self.ci.HandleCommand("help", res)
+        time.sleep(0.1)
         self.assertTrue(res.Succeeded())
         self.assertTrue(res.GetOutput().startswith(
             'The following is a list of built-in, permanent debugger commands'))