Skip to content

Commit 57c2b7f

Browse files
zyn-likusmour
authored andcommitted
fix lldb-dap attach test case
Summary: The test cases added to TestDAP_attach.py in D70663297 was problematic . The test was failed when the sandcastle task test the lldb. The attach test fails because it tries to attach to "a.out" and there are a bunch of those running during the first test run. But could be only one on a re-run. This fix removed the unnecessary code to launch the lldb-dap. Test Plan: 1. lldb-dotest -f TestDAP_attach.TestDAP_attach.test_session_id_update 2. ninja check-lldb : P1785663029, this test case didn't fail. Reviewers: peix, jalalonde, #lldb_team Reviewed By: peix Differential Revision: https://phabricator.intern.facebook.com/D72996648 Tasks: T221156034
1 parent 58d1618 commit 57c2b7f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,22 +227,19 @@ def test_terminate_commands(self):
227227
pattern=terminateCommands[0],
228228
)
229229
self.verify_commands("terminateCommands", output, terminateCommands)
230-
230+
231231
def test_session_id_update(self):
232232
self.build_and_create_debug_adapter()
233233
program = self.getBuildArtifact("a.out")
234-
235-
def spawn(program):
236-
process = subprocess.Popen(
237-
[program], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
238-
)
239-
self.spawn_thread = threading.Thread(
240-
target=spawn,
241-
args=(program,),
234+
self.process = subprocess.Popen(
235+
[program],
236+
stdin=subprocess.PIPE,
237+
stdout=subprocess.PIPE,
238+
stderr=subprocess.PIPE,
242239
)
243-
self.spawn_thread.start()
240+
244241
postRunCommands = ["script print('Actual_Session_ID: ' + str(os.getenv('VSCODE_DEBUG_SESSION_ID')))"]
245-
self.attach(program=program, vscode_session_id="test_session_id", postRunCommands=postRunCommands)
242+
self.attach(pid=self.process.pid, vscode_session_id="test_session_id", postRunCommands=postRunCommands)
246243
output = self.get_console()
247244
lines = filter(lambda x: 'Actual_Session_ID' in x, output.splitlines())
248245
self.assertTrue(

0 commit comments

Comments
 (0)