From 089f552233a0e0042d40199202f110335f78bcfd Mon Sep 17 00:00:00 2001 From: Haijun Zhu Date: Fri, 6 May 2016 02:20:30 -0700 Subject: [PATCH] Bind to a random file in unix domain socket test Summary: test console reports "address already in use" failure so add some randomness to it. Reviewed By: yfeldblum Differential Revision: D3265329 fb-gh-sync-id: a825cce787394783bb8d18d92385d2497b163385 fbshipit-source-id: a825cce787394783bb8d18d92385d2497b163385 --- folly/io/async/test/AsyncSocketTest2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/folly/io/async/test/AsyncSocketTest2.cpp b/folly/io/async/test/AsyncSocketTest2.cpp index 549dc294..d7765445 100644 --- a/folly/io/async/test/AsyncSocketTest2.cpp +++ b/folly/io/async/test/AsyncSocketTest2.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -2122,7 +2123,7 @@ TEST(AsyncSocketTest, UnixDomainSocketTest) { std::shared_ptr serverSocket( AsyncServerSocket::newSocket(&eventBase)); string path(1, 0); - path.append("/anonymous"); + path.append(folly::to("/anonymous", folly::Random::rand64())); folly::SocketAddress serverAddress; serverAddress.setFromPath(path); serverSocket->bind(serverAddress); -- 2.34.1