Commit 450fee03 authored by Dave Watson's avatar Dave Watson Committed by Ajit Banerjee

SharedThreadPool unittest

Summary: Add a test to check that the accept IOPool can be the same as the IO worker thread pool

Test Plan: unittest

Reviewed By: jsedgwick@fb.com

Subscribers: doug, fugalh, njormrod, folly-diffs@

FB internal diff: D1710628

Signature: t1:1710628:1417469919:6d81a9426b61e9f1b804114f895ed541e547110f
parent 1ed040e7
......@@ -169,3 +169,37 @@ TEST(Bootstrap, ServerAcceptGroup2Test) {
CHECK(factory->pipelines == 1);
}
TEST(Bootstrap, SharedThreadPool) {
auto pool = std::make_shared<IOThreadPoolExecutor>(2);
TestServer server;
auto factory = std::make_shared<TestPipelineFactory>();
server.childPipeline(factory);
server.group(pool, pool);
server.bind(0);
SocketAddress address;
server.getSockets()[0]->getAddress(&address);
TestClient client;
client.connect(address);
TestClient client2;
client2.connect(address);
TestClient client3;
client3.connect(address);
TestClient client4;
client4.connect(address);
TestClient client5;
client5.connect(address);
EventBaseManager::get()->getEventBase()->loop();
server.stop();
CHECK(factory->pipelines == 5);
}
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