-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Copy link
Labels
Description
While investing some lldb-dap attach issues I have been running the lldb-dap test suite and one failure I came across is the test that attaches by name attached to another running tests a.out.
From the logs for TestDAP_attach.test_by_name_waitFor
llvm-project/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
Lines 98 to 115 in 8d02529
| def test_by_name_waitFor(self): | |
| """ | |
| Tests attaching to a process by process name and waiting for the | |
| next instance of a process to be launched, ingoring all current | |
| ones. | |
| """ | |
| self.build_and_create_debug_adapter() | |
| program = self.getBuildArtifact("a.out") | |
| self.spawn_thread = threading.Thread( | |
| target=spawn_and_wait, | |
| args=( | |
| program, | |
| 1.0, | |
| ), | |
| ) | |
| self.spawn_thread.start() | |
| self.attach(program=program, waitFor=True) | |
| self.set_and_hit_breakpoint(continueToExit=True) |
1746130571.456615925 <-- (stdin/stdout) {"body":{"isLocalProcess":true,"name":"/Users/harjohn/Projects/lldb-build/lldb-test-build.noindex/tools/lldb-dap/commands/TestDAP_commands.test_command_directive_abort_on_error_post_run_commands/a.out","startMethod":"attach","systemProcessId":97352},"event":"process","seq":0,"type":"event"}
It ended up attaching to TestDAP_commands.test_command_directive_abort_on_error_post_run_commands/a.out, which is the wrong binary.
This likely happened because the tests were running in parallel on my machine but we should see if we can prevent this from happening.