https://github.com/kusmour updated 
https://github.com/llvm/llvm-project/pull/137278

>From b5e0b6e31a6bd2145fce2f87200d1220627df9a6 Mon Sep 17 00:00:00 2001
From: Wanyi Ye <wa...@meta.com>
Date: Thu, 24 Apr 2025 13:30:26 -0700
Subject: [PATCH 1/3] [lldb-dap] Fix TestDap_attach.py flakiness

Looks like these 2 test cases should be re-enabled in 
https://github.com/llvm/llvm-project/commit/0b8dfb5762fdc350c5071c9eeffd4f7e4d495e98
But only the comments got removed. The skip statement survived the change.
---
 .../Python/lldbsuite/test/tools/lldb-dap/dap_server.py    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index dadf6b1f8774c..20f5286da3203 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -612,7 +612,13 @@ def request_attach(
         if gdbRemoteHostname is not None:
             args_dict["gdb-remote-hostname"] = gdbRemoteHostname
         command_dict = {"command": "attach", "type": "request", "arguments": 
args_dict}
-        return self.send_recv(command_dict)
+        response = self.send_recv(command_dict)
+
+        if response["success"]:
+            # Wait for a 'process' and 'initialized' event in any order
+            self.wait_for_event(filter=["process", "initialized"])
+            self.wait_for_event(filter=["process", "initialized"])
+        return response
 
     def request_breakpointLocations(
         self, file_path, line, end_line=None, column=None, end_column=None

>From 2c5ff68fb979e9030dd4dd5b530179fe0ca9f00e Mon Sep 17 00:00:00 2001
From: Wanyi Ye <wa...@meta.com>
Date: Thu, 24 Apr 2025 18:43:18 -0700
Subject: [PATCH 2/3] [lldb-dap] Re-enable test cases on Darwin

Summary:
Looks like some test cases should be re-enabled in 
https://github.com/llvm/llvm-project/commit/0b8dfb5762fdc350c5071c9eeffd4f7e4d495e98
But only comments was removed. The skip statements survived the change.

Test Plan:
./bin/llvm-lit -va 
/Users/wanyi/llvm-upstream/llvm-project/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
All tests passed locally on my mac
---
 lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py 
b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
index b9fbf2c8d14f9..dcdfada2ff4c2 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
@@ -93,7 +93,6 @@ def cleanup():
         self.set_and_hit_breakpoint(continueToExit=True)
 
     @skipUnlessDarwin
-    @skipIfDarwin
     @skipIfNetBSD  # Hangs on NetBSD as well
     def test_by_name_waitFor(self):
         """
@@ -114,7 +113,6 @@ def test_by_name_waitFor(self):
         self.attach(program=program, waitFor=True)
         self.set_and_hit_breakpoint(continueToExit=True)
 
-    @skipIfDarwin
     @skipIfNetBSD  # Hangs on NetBSD as well
     def test_commands(self):
         """
@@ -201,7 +199,6 @@ def test_commands(self):
         self.verify_commands("exitCommands", output, exitCommands)
         self.verify_commands("terminateCommands", output, terminateCommands)
 
-    @skipIfDarwin
     @skipIfNetBSD  # Hangs on NetBSD as well
     @skipIf(
         archs=["arm", "aarch64"]

>From 0e6d4192962211d472cdbaff9e4f3b87c181f455 Mon Sep 17 00:00:00 2001
From: Wanyi Ye <wa...@meta.com>
Date: Thu, 24 Apr 2025 19:28:17 -0700
Subject: [PATCH 3/3] [lldb-dap] Improve the process & initialized event check

---
 .../lldbsuite/test/tools/lldb-dap/dap_server.py    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 20f5286da3203..017abd89c36da 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -374,6 +374,12 @@ def wait_for_event(self, filter=None, timeout=None):
             )
         return None
 
+    def wait_for_process_and_initialized(self, timeout=None):
+        # Wait for a 'process' and 'initialized' event in any order
+        first_event = self.wait_for_event(filter=["process", "initialized"])
+        second_event = "initialized" if first_event["event"] == "process" else 
"process"
+        self.wait_for_event(filter=[second_event])
+
     def wait_for_stopped(self, timeout=None):
         stopped_events = []
         stopped_event = self.wait_for_event(
@@ -615,9 +621,7 @@ def request_attach(
         response = self.send_recv(command_dict)
 
         if response["success"]:
-            # Wait for a 'process' and 'initialized' event in any order
-            self.wait_for_event(filter=["process", "initialized"])
-            self.wait_for_event(filter=["process", "initialized"])
+            self.wait_for_process_and_initialized()
         return response
 
     def request_breakpointLocations(
@@ -871,9 +875,7 @@ def request_launch(
         response = self.send_recv(command_dict)
 
         if response["success"]:
-            # Wait for a 'process' and 'initialized' event in any order
-            self.wait_for_event(filter=["process", "initialized"])
-            self.wait_for_event(filter=["process", "initialized"])
+            self.wait_for_process_and_initialized()
         return response
 
     def request_next(self, threadId, granularity="statement"):

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to