<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/138197>138197</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lldb-dap] Parallel test execution caused attach by name failure
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ashgti
      </td>
    </tr>
</table>

<pre>
    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` https://github.com/llvm/llvm-project/blob/8d02529f77f809a1a8db623a3a124a33f0be94b9/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py#L98-L115

```
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.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVE-L47gT_TTKpeggl2M7PviQmcbQ0D_ow_zYo5GscqxZRfJKcjL59otsJ90Me1lYMJiSXv17qnoiBH22RA0rvrHidSfmODrfiDCeo95Jp-7NH6M2BNpeKURtzxDchcAYJV-UmEDEKPoRdAgzBXiDUVwJJJEFP1ub8HH8Ao8UIoRZRwJhFThLMAhtZk_wBr24EIjeuxBAh8VxwcdRxC0RBZB3sAtwPVAQHQjr4kj-MyeFGICVXOzdHFnJ94yfGD-13l3Wgtw5wOB8wvygEF9PH90acJ98O3nvUpLuJnRsnWclhzHGKbD8xLBl2J51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