https://github.com/emrekultursay updated https://github.com/llvm/llvm-project/pull/137405
>From 65de31524033192d1c14af29b70b8f32bac3be55 Mon Sep 17 00:00:00 2001 From: Emre Kultursay <emrekultur...@google.com> Date: Fri, 25 Apr 2025 22:04:28 +0000 Subject: [PATCH 1/2] Skip tests if socket name is longer than 107 bytes To fix the test failures introduced in Commit 488eeb3 --- lldb/unittests/Host/SocketTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lldb/unittests/Host/SocketTest.cpp b/lldb/unittests/Host/SocketTest.cpp index 5bfb48b52f7e7..70708db57c7e3 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()); @@ -370,6 +374,10 @@ TEST_F(SocketTest, AbstractSocketFromBoundNativeSocket) { 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); ASSERT_THAT_ERROR(error.takeError(), llvm::Succeeded()); >From 8cfc092a631d7122ae84c454bb784f6c265f0267 Mon Sep 17 00:00:00 2001 From: Emre Kultursay <emrekultur...@google.com> Date: Fri, 25 Apr 2025 22:30:26 +0000 Subject: [PATCH 2/2] Use GTEST_SKIP instead of return --- lldb/unittests/Host/SocketTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/unittests/Host/SocketTest.cpp b/lldb/unittests/Host/SocketTest.cpp index 70708db57c7e3..77366593f05f8 100644 --- a/lldb/unittests/Host/SocketTest.cpp +++ b/lldb/unittests/Host/SocketTest.cpp @@ -351,7 +351,7 @@ TEST_F(SocketTest, DomainSocketFromBoundNativeSocket) { // Skip the test if the $TMPDIR is too long to hold a domain socket. if (name.size() > 107u) - return; + GTEST_SKIP() << "$TMPDIR is too long to hold a domain socket"; DomainSocket socket(true); Status error = socket.Listen(name, /*backlog=*/10); @@ -376,7 +376,7 @@ TEST_F(SocketTest, AbstractSocketFromBoundNativeSocket) { // Skip the test if the $TMPDIR is too long to hold a domain socket. if (name.size() > 107u) - return; + GTEST_SKIP() << "$TMPDIR is too long to hold a domain socket"; AbstractSocket socket; Status error = socket.Listen(name, /*backlog=*/10); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits