JDevlieghere created this revision.
JDevlieghere added a reviewer: aprantl.
Herald added a subscriber: abidh.
Herald added a project: LLDB.
Adrian added a sanity check to the socket tests to ensure the $TMPDIR is not to
long for a socket. While this is great for diagnosing the problem it doesn't
really solve the problem for environment where you have no control over that
variable such as in CI. I propose to just skip the test in that case similar to
what we do for tests that rely on targets that are not currently build, etc.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D67972
Files:
unittests/Host/SocketTest.cpp
Index: unittests/Host/SocketTest.cpp
===================================================================
--- unittests/Host/SocketTest.cpp
+++ unittests/Host/SocketTest.cpp
@@ -93,8 +93,10 @@
std::error_code EC =
llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
ASSERT_FALSE(EC);
llvm::sys::path::append(Path, "test");
- // If this fails, $TMPDIR is too long to hold a domain socket.
- EXPECT_LE(Path.size(), 107u);
+
+ // Skip the test if the $TMPDIR is too long to hold a domain socket.
+ if (Path.size() > 107u)
+ return;
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
@@ -196,8 +198,10 @@
llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept",
domain_path);
ASSERT_FALSE(EC);
llvm::sys::path::append(domain_path, "test");
- // If this fails, $TMPDIR is too long to hold a domain socket.
- EXPECT_LE(domain_path.size(), 107u);
+
+ // Skip the test if the $TMPDIR is too long to hold a domain socket.
+ if (domain_path.size() > 107u)
+ return;
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
Index: unittests/Host/SocketTest.cpp
===================================================================
--- unittests/Host/SocketTest.cpp
+++ unittests/Host/SocketTest.cpp
@@ -93,8 +93,10 @@
std::error_code EC = llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
ASSERT_FALSE(EC);
llvm::sys::path::append(Path, "test");
- // If this fails, $TMPDIR is too long to hold a domain socket.
- EXPECT_LE(Path.size(), 107u);
+
+ // Skip the test if the $TMPDIR is too long to hold a domain socket.
+ if (Path.size() > 107u)
+ return;
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
@@ -196,8 +198,10 @@
llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", domain_path);
ASSERT_FALSE(EC);
llvm::sys::path::append(domain_path, "test");
- // If this fails, $TMPDIR is too long to hold a domain socket.
- EXPECT_LE(domain_path.size(), 107u);
+
+ // Skip the test if the $TMPDIR is too long to hold a domain socket.
+ if (domain_path.size() > 107u)
+ return;
std::unique_ptr<DomainSocket> socket_a_up;
std::unique_ptr<DomainSocket> socket_b_up;
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits