Despite #163452, this is still timing out on our Arm bot. Probably because schedling is unpredicatable, but that's just reality so I'm not going to fight that. -- Exit Code: -9 Timeout: Reached timeout of 600 seconds ====================================================================== ERROR: test_by_name_waitFor (TestDAP_attach.TestDAP_attach) Tests waiting for, and attaching to a process by process name that ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2066, in tearDown Base.tearDown(self) File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1106, in tearDown hook() # try the plain call and hope it works File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py", line 499, in cleanup self.dap_server.request_disconnect(terminateDebuggee=True) File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 926, in request_disconnect return self._send_recv(command_dict) File "/home/tcwg-buildbot/worker/lldb-arm-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 548, in _send_recv raise ValueError(f"no response for {request!r}") ValueError: no response for {'command': 'disconnect', 'type': 'request', 'arguments': {'terminateDebuggee': True}, 'seq': 3} Config=arm-/home/tcwg-buildbot/worker/lldb-arm-ubuntu/build/bin/clang ---------------------------------------------------------------------- I don't think this is an Arm thing specifically, but it's the most diplomatic way to stop false negatives from this test.
78 lines
2.3 KiB
Python
78 lines
2.3 KiB
Python
"""
|
|
Test lldb-dap attach request
|
|
"""
|
|
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
import lldbdap_testcase
|
|
import subprocess
|
|
import threading
|
|
import time
|
|
|
|
|
|
# Often fails on Arm Linux, but not specifically because it's Arm, something in
|
|
# process scheduling can cause a massive (minutes) delay during this test.
|
|
@skipIf(oslist=["linux"], archs=["arm$"])
|
|
class TestDAP_attach(lldbdap_testcase.DAPTestCaseBase):
|
|
def spawn(self, args):
|
|
self.process = subprocess.Popen(
|
|
args,
|
|
stdin=subprocess.PIPE,
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE,
|
|
universal_newlines=True,
|
|
)
|
|
|
|
def spawn_and_wait(self, program, delay):
|
|
time.sleep(delay)
|
|
self.spawn([program])
|
|
self.process.wait()
|
|
|
|
def continue_and_verify_pid(self):
|
|
self.do_continue()
|
|
out, _ = self.process.communicate("foo")
|
|
self.assertIn(f"pid = {self.process.pid}", out)
|
|
|
|
def test_by_pid(self):
|
|
"""
|
|
Tests attaching to a process by process ID.
|
|
"""
|
|
program = self.build_and_create_debug_adapter_for_attach()
|
|
self.spawn([program])
|
|
self.attach(pid=self.process.pid)
|
|
self.continue_and_verify_pid()
|
|
|
|
def test_by_name(self):
|
|
"""
|
|
Tests attaching to a process by process name.
|
|
"""
|
|
program = self.build_and_create_debug_adapter_for_attach()
|
|
|
|
# Use a file as a synchronization point between test and inferior.
|
|
pid_file_path = lldbutil.append_to_process_working_directory(
|
|
self, "pid_file_%d" % (int(time.time()))
|
|
)
|
|
self.spawn([program, pid_file_path])
|
|
lldbutil.wait_for_file_on_target(self, pid_file_path)
|
|
|
|
self.attach(program=program)
|
|
self.continue_and_verify_pid()
|
|
|
|
def test_by_name_waitFor(self):
|
|
"""
|
|
Tests waiting for, and attaching to a process by process name that
|
|
doesn't exist yet.
|
|
"""
|
|
program = self.build_and_create_debug_adapter_for_attach()
|
|
self.spawn_thread = threading.Thread(
|
|
target=self.spawn_and_wait,
|
|
args=(
|
|
program,
|
|
1.0,
|
|
),
|
|
)
|
|
self.spawn_thread.start()
|
|
self.attach(program=program, waitFor=True)
|
|
self.continue_and_verify_pid()
|