omjavaid created this revision.
omjavaid added reviewers: clayborg, labath.
omjavaid requested review of this revision.

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 the test_launch


https://reviews.llvm.org/D99491

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


Index: lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
===================================================================
--- lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
+++ lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
@@ -37,7 +37,7 @@
             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')])
Index: 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -340,7 +340,8 @@
                          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 @@
         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)


Index: lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
===================================================================
--- lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
+++ lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
@@ -37,7 +37,7 @@
             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')])
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -340,7 +340,8 @@
                          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 @@
         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)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PAT... Muhammad Omair Javaid via Phabricator via lldb-commits

Reply via email to