[Lldb-commits] [lldb] 42c3b5e - Fix cleanup error in TestVSCode_disconnect.test_launch

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 30 03:37:03 PDT 2021


Author: Muhammad Omair Javaid
Date: 2021-03-30T15:36:45+05:00
New Revision: 42c3b5e5b6ffd39041c3d34f01e7162573eefd6e

URL: https://github.com/llvm/llvm-project/commit/42c3b5e5b6ffd39041c3d34f01e7162573eefd6e
DIFF: https://github.com/llvm/llvm-project/commit/42c3b5e5b6ffd39041c3d34f01e7162573eefd6e.diff

LOG: Fix cleanup error in TestVSCode_disconnect.test_launch

TestVSCode_disconnect.test_launch fails with clean up error because
disconnect gets called twice once from the test case and once from
the tear down hook.

This patch disables disconnect after its been called from test_launch

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D99491

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
    lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
index 0c43f8ca5a97..7ddb3164cb3d 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -340,7 +340,8 @@ def build_and_launch(self, program, args=None, cwd=None, env=None,
                          trace=False, initCommands=None, preRunCommands=None,
                          stopCommands=None, exitCommands=None,
                          terminateCommands=None, sourcePath=None,
-                         debuggerRoot=None, runInTerminal=False):
+                         debuggerRoot=None, runInTerminal=False,
+                         disconnectAutomatically=True):
         '''Build the default Makefile target, create the VSCode debug adaptor,
            and launch the process.
         '''
@@ -350,4 +351,5 @@ def build_and_launch(self, program, args=None, cwd=None, env=None,
         return self.launch(program, args, cwd, env, stopOnEntry, disableASLR,
                     disableSTDIO, shellExpandArguments, trace,
                     initCommands, preRunCommands, stopCommands, exitCommands,
-                    terminateCommands, sourcePath, debuggerRoot, runInTerminal=runInTerminal)
+                    terminateCommands, sourcePath, debuggerRoot, runInTerminal=runInTerminal,
+                    disconnectAutomatically=disconnectAutomatically)

diff  --git a/lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py b/lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
index 91b2ae783048..226aad63e234 100644
--- a/lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
+++ b/lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
@@ -37,7 +37,7 @@ def test_launch(self):
             created.
         """
         program = self.getBuildArtifact("a.out")
-        self.build_and_launch(program)
+        self.build_and_launch(program, disconnectAutomatically=False)
 
         # We set a breakpoint right before the side effect file is created
         self.set_source_breakpoints(self.source, [line_number(self.source, '// breakpoint')])


        


More information about the lldb-commits mailing list