Commit 4ffad0ef authored by Dave Watson's avatar Dave Watson

Only test multi accept if reuse port supported

Summary: Some contbuild machines aren't on 3.10 yet.

Test Plan:
fbconfig folly/experimental/wangle/bootstrap; fbmake runtests
tested on 3.2 and 3.10

Reviewed By: jsedgwick@fb.com

Subscribers: doug, fugalh, folly-diffs@

FB internal diff: D1732040

Tasks: 5800250

Signature: t1:1732040:1418250452:a3203ab5769494594f2bf0b50f1c62052ddeb24c
parent db376afe
......@@ -138,6 +138,20 @@ TEST(Bootstrap, ServerAcceptGroupTest) {
TEST(Bootstrap, ServerAcceptGroup2Test) {
// Verify that server is using the accept IO group
// Check if reuse port is supported, if not, don't run this test
try {
EventBase base;
auto serverSocket = AsyncServerSocket::newSocket(&base);
serverSocket->bind(0);
serverSocket->listen(0);
serverSocket->startAccepting();
serverSocket->setReusePortEnabled(true);
serverSocket->stopAccepting();
} catch(...) {
LOG(INFO) << "Reuse port probably not supported";
return;
}
TestServer server;
auto factory = std::make_shared<TestPipelineFactory>();
server.childPipeline(factory);
......
......@@ -145,7 +145,7 @@ class ServerBootstrap {
}
bool reusePort = false;
if (acceptor_group_->numThreads() >= 0) {
if (acceptor_group_->numThreads() > 1) {
reusePort = true;
}
......
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