Commit ff2ecd36 authored by Pranjal Raihan's avatar Pranjal Raihan Committed by Facebook GitHub Bot

Fix folly/io/async/test:async_test - AsyncSocketTest.ConnectionExpiry

Summary: The worker thread just needed to be killed before the `AcceptCallback`. `AsyncServerSocket` calls a method on this callback class in its dtor, so it must either be alive or removed using `removeAcceptCallback`.

Differential Revision: D24972293

fbshipit-source-id: 2c7b6d64c2b9b8c00d03107002fa31e565df2a01
parent 04eafeb6
......@@ -4210,7 +4210,6 @@ TEST(AsyncSocketTest, ConnectionExpiry) {
constexpr auto kConnectionExpiryDuration = milliseconds(10);
serverSocket->setQueueTimeout(kConnectionExpiryDuration);
ScopedEventBaseThread acceptThread("ioworker_test");
TestAcceptCallback acceptCb;
acceptCb.setConnectionAcceptedFn(
[&, called = false](auto&&...) mutable {
......@@ -4230,6 +4229,7 @@ TEST(AsyncSocketTest, ConnectionExpiry) {
// second message expires before it has a chance to dequeue.
std::this_thread::sleep_for(kConnectionExpiryDuration);
});
ScopedEventBaseThread acceptThread("ioworker_test");
TestConnectionEventCallback connectionEventCb;
serverSocket->setConnectionEventCallback(&connectionEventCb);
......
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