Skip to content

Commit d7ab4d2

Browse files
committed
Skip tests if socket name is longer than 107 bytes
To fix the test failures introduced in Commit 488eeb3
1 parent b571aa4 commit d7ab4d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lldb/unittests/Host/SocketTest.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ TEST_F(SocketTest, DomainSocketFromBoundNativeSocket) {
349349
ASSERT_FALSE(EC);
350350
llvm::sys::path::append(name, "test");
351351

352+
// Skip the test if the $TMPDIR is too long to hold a domain socket.
353+
if (name.size() > 107u)
354+
return;
355+
352356
DomainSocket socket(true);
353357
Status error = socket.Listen(name, /*backlog=*/10);
354358
ASSERT_THAT_ERROR(error.takeError(), llvm::Succeeded());
@@ -369,6 +373,10 @@ TEST_F(SocketTest, AbstractSocketFromBoundNativeSocket) {
369373
llvm::sys::fs::createUniquePath("AbstractSocketFromBoundNativeSocket", name,
370374
true);
371375
llvm::sys::path::append(name, "test");
376+
377+
// Skip the test if the $TMPDIR is too long to hold a domain socket.
378+
if (name.size() > 107u)
379+
return;
372380

373381
AbstractSocket socket;
374382
Status error = socket.Listen(name, /*backlog=*/10);

0 commit comments

Comments
 (0)