Commit 089f5522 authored by Haijun Zhu's avatar Haijun Zhu Committed by Facebook Github Bot 4

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
parent af77aab7
......@@ -19,6 +19,7 @@
#include <folly/io/async/EventBase.h>
#include <folly/RWSpinLock.h>
#include <folly/SocketAddress.h>
#include <folly/Random.h>
#include <folly/io/IOBuf.h>
#include <folly/io/async/test/AsyncSocketTest.h>
......@@ -2122,7 +2123,7 @@ TEST(AsyncSocketTest, UnixDomainSocketTest) {
std::shared_ptr<AsyncServerSocket> serverSocket(
AsyncServerSocket::newSocket(&eventBase));
string path(1, 0);
path.append("/anonymous");
path.append(folly::to<string>("/anonymous", folly::Random::rand64()));
folly::SocketAddress serverAddress;
serverAddress.setFromPath(path);
serverSocket->bind(serverAddress);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment