Skip to content

[lldb-dap] Parallel test execution caused attach by name failure #138197

@ashgti

Description

@ashgti

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

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions