Author: jankratochvil Date: Mon Jul 29 09:10:16 2019 New Revision: 367234 URL: http://llvm.org/viewvc/llvm-project?rev=367234&view=rev Log: [lldb] Increase testsuite packet-timeout 5secs -> 1min
rL357954 did increase `packet-timeout` 1sec -> 5secs. Which is IMO about the maximum timeout reasonable for regular use. But for testsuite I think the timeout should be higher as the testsuite runs in parallel and it can be run even on slow hosts and with other load (moreover if it runs on some slow arch). I have chosen 60 secs, that should be enough hopefully. Larger value could make debugging with hanging `lldb-server` annoying. This patch was based on this testsuite timeout: http://lab.llvm.org:8014/builders/lldb-x86_64-fedora/builds/546/steps/test/logs/stdio FAIL: test_connect (TestGDBRemoteClient.TestGDBRemoteClient) Test connecting to a remote gdb server ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py", line 13, in test_connect process = self.connect(target) File "/home/jkratoch/slave-lldb-x86_64-fedora/lldb-x86_64-fedora/llvm/tools/lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py", line 480, in connect self.assertTrue(error.Success(), error.description) AssertionError: False is not True : failed to get reply to handshake packet Differential Revision: https://reviews.llvm.org/D65271 Modified: lldb/trunk/lit/lit-lldb-init.in lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py lldb/trunk/tools/lldb-test/lldb-test.cpp Modified: lldb/trunk/lit/lit-lldb-init.in URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit-lldb-init.in?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/lit/lit-lldb-init.in (original) +++ lldb/trunk/lit/lit-lldb-init.in Mon Jul 29 09:10:16 2019 @@ -1,3 +1,4 @@ # LLDB init file for the LIT tests. settings set symbols.enable-external-lookup false +settings set plugin.process.gdb-remote.packet-timeout 60 settings set interpreter.echo-comment-commands false Modified: lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template (original) +++ lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template Mon Jul 29 09:10:16 2019 @@ -32,6 +32,8 @@ int main(int argc, char** argv) { SBDebugger::Initialize(); SBDebugger dbg = SBDebugger::Create(); dbg.HandleCommand("settings set symbols.enable-external-lookup false"); + dbg.HandleCommand( + "settings set plugin.process.gdb-remote.packet-timeout 60"); try { if (!dbg.IsValid()) Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py Mon Jul 29 09:10:16 2019 @@ -21,6 +21,7 @@ class TestNoWatchpointSupportInfo(GDBRem def threadStopInfo(self, threadnum): if threadnum == 0x1ff0d: return "T02thread:1ff0d;thread-pcs:10001bc00;" + return "" def setBreakpoint(self, packet): if packet.startswith("Z2,"): Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jul 29 09:10:16 2019 @@ -696,6 +696,17 @@ class Base(unittest2.TestCase): """Return absolute path to a file in the test's source directory.""" return os.path.join(self.getSourceDir(), name) + @staticmethod + def setUpCommands(): + return [ + # Disable Spotlight lookup. The testsuite creates + # different binaries with the same UUID, because they only + # differ in the debug info, which is not being hashed. + "settings set symbols.enable-external-lookup false", + + # Testsuite runs in parallel and the host can have also other load. + "settings set plugin.process.gdb-remote.packet-timeout 60"] + def setUp(self): """Fixture for unittest test case setup. @@ -714,7 +725,8 @@ class Base(unittest2.TestCase): else: self.lldbVSCodeExec = None - self.lldbOption = "-o 'settings set symbols.enable-external-lookup false'" + self.lldbOption = " ".join( + "-o '" + s + "'" for s in self.setUpCommands()) # If we spawn an lldb process for test (via pexpect), do not load the # init file unless told otherwise. @@ -1854,10 +1866,8 @@ class TestBase(Base): self.runCmd('settings set symbols.clang-modules-cache-path "%s"' % mod_cache) - # Disable Spotlight lookup. The testsuite creates - # different binaries with the same UUID, because they only - # differ in the debug info, which is not being hashed. - self.runCmd('settings set symbols.enable-external-lookup false') + for s in self.setUpCommands(): + self.runCmd(s) # Disable color. self.runCmd("settings set use-color false") Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py Mon Jul 29 09:10:16 2019 @@ -11,7 +11,8 @@ class VSCodeTestCaseBase(TestBase): '''Create the Visual Studio Code debug adaptor''' self.assertTrue(os.path.exists(self.lldbVSCodeExec), 'lldb-vscode must exist') - self.vscode = vscode.DebugAdaptor(executable=self.lldbVSCodeExec) + self.vscode = vscode.DebugAdaptor( + executable=self.lldbVSCodeExec, init_commands=Base.setUpCommands()) def build_and_create_debug_adaptor(self): self.build() Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py Mon Jul 29 09:10:16 2019 @@ -99,7 +99,7 @@ def read_packet_thread(vs_comm): class DebugCommunication(object): - def __init__(self, recv, send): + def __init__(self, recv, send, init_commands): self.trace_file = None self.send = send self.recv = recv @@ -118,6 +118,7 @@ class DebugCommunication(object): self.output = {} self.configuration_done_sent = False self.frame_scopes = {} + self.init_commands = init_commands @classmethod def encode_content(cls, s): @@ -447,8 +448,7 @@ class DebugCommunication(object): args_dict['waitFor'] = waitFor if trace: args_dict['trace'] = trace - args_dict['initCommands'] = [ - 'settings set symbols.enable-external-lookup false'] + args_dict['initCommands'] = self.init_commands if initCommands: args_dict['initCommands'].extend(initCommands) if preRunCommands: @@ -578,8 +578,7 @@ class DebugCommunication(object): args_dict['shellExpandArguments'] = shellExpandArguments if trace: args_dict['trace'] = trace - args_dict['initCommands'] = [ - 'settings set symbols.enable-external-lookup false'] + args_dict['initCommands'] = self.init_commands if initCommands: args_dict['initCommands'].extend(initCommands) if preRunCommands: @@ -822,7 +821,7 @@ class DebugCommunication(object): class DebugAdaptor(DebugCommunication): - def __init__(self, executable=None, port=None): + def __init__(self, executable=None, port=None, init_commands=[]): self.process = None if executable is not None: self.process = subprocess.Popen([executable], @@ -830,11 +829,12 @@ class DebugAdaptor(DebugCommunication): stdout=subprocess.PIPE, stderr=subprocess.PIPE) DebugCommunication.__init__(self, self.process.stdout, - self.process.stdin) + self.process.stdin, init_commands) elif port is not None: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('127.0.0.1', port)) - DebugCommunication.__init__(self, s.makefile('r'), s.makefile('w')) + DebugCommunication.__init__(self, s.makefile('r'), s.makefile('w'), + init_commands) def get_pid(self): if self.process: Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=367234&r1=367233&r2=367234&view=diff ============================================================================== --- lldb/trunk/tools/lldb-test/lldb-test.cpp (original) +++ lldb/trunk/tools/lldb-test/lldb-test.cpp Mon Jul 29 09:10:16 2019 @@ -976,6 +976,10 @@ int main(int argc, const char *argv[]) { auto Dbg = lldb_private::Debugger::CreateInstance(); ModuleList::GetGlobalModuleListProperties().SetEnableExternalLookup(false); + CommandReturnObject Result; + Dbg->GetCommandInterpreter().HandleCommand( + "settings set plugin.process.gdb-remote.packet-timeout 60", + /*add_to_history*/ eLazyBoolNo, Result); if (!opts::Log.empty()) Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs()); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits