Commit c77b1e7d authored by Dave Watson's avatar Dave Watson Committed by Viswanath Sivakumar

fix bootstrap test on older kernels

Summary: another unittest that doesn't work without reuseport support, add a check

Test Plan: ran it on sandcastle187.prn2, works

Reviewed By: njormrod@fb.com

Subscribers: doug, fugalh, folly-diffs@

FB internal diff: D1764395

Tasks: 5931982

Signature: t1:1764395:1420490666:658aef148ebca9484534a0cebb228570e28f1002
parent 23027364
......@@ -171,6 +171,20 @@ TEST(Bootstrap, ServerAcceptGroup2Test) {
}
TEST(Bootstrap, SharedThreadPool) {
// 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;
}
auto pool = std::make_shared<IOThreadPoolExecutor>(2);
TestServer server;
......
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