The test has a 10 seconds sleep which means we have a limited window to perform the attach. Although this may work reliably at desk, there's no guarantee that both the inferior and lldb get scheduled within a certain time on a heavily loaded CI node.
This test was already correctly updated to use file-based synchronization to determine whether the process has launched. We should do something similar to halt the process until we've had a chance to attach to it. We can use a file for this, or have an infinite loop that we break out of by running an expression from the test.
See #162523 for more context on timeouts.