[Lldb-commits] [lldb] Skip tests if socket name is longer than 107 bytes (PR #137405)

via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 25 15:07:56 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Emre Kultursay (emrekultursay)

<details>
<summary>Changes</summary>

To fix the test failures introduced in Commit 488eeb3

---
Full diff: https://github.com/llvm/llvm-project/pull/137405.diff


1 Files Affected:

- (modified) lldb/unittests/Host/SocketTest.cpp (+8) 


``````````diff
diff --git a/lldb/unittests/Host/SocketTest.cpp b/lldb/unittests/Host/SocketTest.cpp
index 5bfb48b52f7e7..df67943892420 100644
--- a/lldb/unittests/Host/SocketTest.cpp
+++ b/lldb/unittests/Host/SocketTest.cpp
@@ -349,6 +349,10 @@ TEST_F(SocketTest, DomainSocketFromBoundNativeSocket) {
   ASSERT_FALSE(EC);
   llvm::sys::path::append(name, "test");
 
+  // Skip the test if the $TMPDIR is too long to hold a domain socket.
+  if (name.size() > 107u)
+    return;
+
   DomainSocket socket(true);
   Status error = socket.Listen(name, /*backlog=*/10);
   ASSERT_THAT_ERROR(error.takeError(), llvm::Succeeded());
@@ -369,6 +373,10 @@ TEST_F(SocketTest, AbstractSocketFromBoundNativeSocket) {
   llvm::sys::fs::createUniquePath("AbstractSocketFromBoundNativeSocket", name,
                                   true);
   llvm::sys::path::append(name, "test");
+  
+  // Skip the test if the $TMPDIR is too long to hold a domain socket.
+  if (name.size() > 107u)
+    return;
 
   AbstractSocket socket;
   Status error = socket.Listen(name, /*backlog=*/10);

``````````

</details>


https://github.com/llvm/llvm-project/pull/137405


More information about the lldb-commits mailing list