proxygen
|
#include <folly/Memory.h>
#include <folly/ScopeGuard.h>
#include <folly/io/async/AsyncTimeout.h>
#include <folly/io/async/EventBase.h>
#include <folly/io/async/EventHandler.h>
#include <folly/io/async/test/SocketPair.h>
#include <folly/io/async/test/Util.h>
#include <folly/portability/Unistd.h>
#include <folly/futures/Promise.h>
#include <atomic>
#include <iostream>
#include <memory>
#include <thread>
Go to the source code of this file.
Classes | |
struct | ScheduledEvent |
class | TestHandler |
struct | TestHandler::EventRecord |
class | PartialReadHandler |
class | PartialWriteHandler |
class | TestTimeout |
class | ReschedulingTimeout |
struct | RunInThreadData |
struct | RunInThreadArg |
class | CountedLoopCallback |
class | TerminateTestCallback |
class | IdleTimeTimeoutSeries |
class | PipeHandler |
Enumerations | |
enum | { BUF_SIZE = 4096 } |
Functions | |
ssize_t | writeToFD (int fd, size_t length) |
size_t | writeUntilFull (int fd) |
ssize_t | readFromFD (int fd, size_t length) |
size_t | readUntilEmpty (int fd) |
void | checkReadUntilEmpty (int fd, size_t expectedLength) |
void | scheduleEvents (EventBase *eventBase, int fd, ScheduledEvent *events) |
TEST (EventBaseTest, ReadEvent) | |
TEST (EventBaseTest, ReadPersist) | |
TEST (EventBaseTest, ReadImmediate) | |
TEST (EventBaseTest, WriteEvent) | |
TEST (EventBaseTest, WritePersist) | |
TEST (EventBaseTest, WriteImmediate) | |
TEST (EventBaseTest, ReadWrite) | |
TEST (EventBaseTest, WriteRead) | |
TEST (EventBaseTest, ReadWriteSimultaneous) | |
TEST (EventBaseTest, ReadWritePersist) | |
TEST (EventBaseTest, ReadPartial) | |
TEST (EventBaseTest, WritePartial) | |
TEST (EventBaseTest, DestroyHandler) | |
TEST (EventBaseTest, RunAfterDelay) | |
TEST (EventBaseTest, RunAfterDelayDestruction) | |
TEST (EventBaseTest, BasicTimeouts) | |
TEST (EventBaseTest, ReuseTimeout) | |
TEST (EventBaseTest, RescheduleTimeout) | |
TEST (EventBaseTest, CancelTimeout) | |
TEST (EventBaseTest, DestroyTimeout) | |
TEST (EventBaseTest, ScheduledFn) | |
TEST (EventBaseTest, ScheduledFnAt) | |
void | runInThreadTestFunc (RunInThreadArg *arg) |
TEST (EventBaseTest, RunInThread) | |
TEST (EventBaseTest, RunInEventBaseThreadAndWait) | |
TEST (EventBaseTest, RunImmediatelyOrRunInEventBaseThreadAndWaitCross) | |
TEST (EventBaseTest, RunImmediatelyOrRunInEventBaseThreadAndWaitWithin) | |
TEST (EventBaseTest, RunImmediatelyOrRunInEventBaseThreadNotLooping) | |
TEST (EventBaseTest, RepeatedRunInLoop) | |
TEST (EventBaseTest, RunInLoopNoTimeMeasurement) | |
TEST (EventBaseTest, RunInLoopStopLoop) | |
TEST (EventBaseTest, messageAvailableException) | |
TEST (EventBaseTest, TryRunningAfterTerminate) | |
TEST (EventBaseTest, CancelRunInLoop) | |
TEST (EventBaseTest, LoopTermination) | |
TEST (EventBaseTest, IdleTime) | |
TEST (EventBaseTest, ThisLoop) | |
TEST (EventBaseTest, EventBaseThreadLoop) | |
TEST (EventBaseTest, EventBaseThreadName) | |
TEST (EventBaseTest, RunBeforeLoop) | |
TEST (EventBaseTest, RunBeforeLoopWait) | |
TEST (EventBaseTest, StopBeforeLoop) | |
TEST (EventBaseTest, RunCallbacksOnDestruction) | |
TEST (EventBaseTest, LoopKeepAlive) | |
TEST (EventBaseTest, LoopKeepAliveInLoop) | |
TEST (EventBaseTest, LoopKeepAliveWithLoopForever) | |
TEST (EventBaseTest, LoopKeepAliveShutdown) | |
TEST (EventBaseTest, LoopKeepAliveAtomic) | |
TEST (EventBaseTest, LoopKeepAliveCast) | |
TEST (EventBaseTest, DrivableExecutorTest) | |
TEST (EventBaseTest, IOExecutorTest) | |
TEST (EventBaseTest, RequestContextTest) | |
TEST (EventBaseTest, CancelLoopCallbackRequestContextTest) | |
anonymous enum |
Enumerator | |
---|---|
BUF_SIZE |
Definition at line 55 of file EventBaseTest.cpp.
void checkReadUntilEmpty | ( | int | fd, |
size_t | expectedLength | ||
) |
Definition at line 108 of file EventBaseTest.cpp.
References ASSERT_EQ, and readUntilEmpty().
Referenced by TEST().
ssize_t readFromFD | ( | int | fd, |
size_t | length | ||
) |
Definition at line 84 of file EventBaseTest.cpp.
References fizz::detail::read().
Referenced by PartialReadHandler::handlerReady(), and ScheduledEvent::perform().
size_t readUntilEmpty | ( | int | fd | ) |
Definition at line 90 of file EventBaseTest.cpp.
References BUF_SIZE, and fizz::detail::read().
Referenced by checkReadUntilEmpty(), TestHandler::handlerReady(), ScheduledEvent::perform(), and TEST().
void runInThreadTestFunc | ( | RunInThreadArg * | arg | ) |
Definition at line 1149 of file EventBaseTest.cpp.
References data, RunInThreadArg::data, RunInThreadData::evb, RunInThreadData::opsToGo, folly::EventBase::terminateLoopSoon(), RunInThreadArg::thread, RunInThreadArg::value, and RunInThreadData::values.
Referenced by TEST().
void scheduleEvents | ( | EventBase * | eventBase, |
int | fd, | ||
ScheduledEvent * | events | ||
) |
Definition at line 136 of file EventBaseTest.cpp.
References folly::netops::bind(), ScheduledEvent::milliseconds, ScheduledEvent::perform(), and folly::TimeoutManager::tryRunAfterDelay().
Referenced by TEST().
TEST | ( | EventBaseTest | , |
ReadEvent | |||
) |
Test a READ event
Definition at line 187 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::test::end(), handler(), ScheduledEvent::length, TestHandler::log, folly::EventBase::loop(), readUntilEmpty(), folly::EventHandler::registerHandler(), scheduleEvents(), start, and T_CHECK_TIMEOUT.
TEST | ( | EventBaseTest | , |
ReadPersist | |||
) |
Test (READ | PERSIST)
Definition at line 231 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::bind(), folly::test::end(), handler(), ScheduledEvent::length, TestHandler::log, folly::EventBase::loop(), readUntilEmpty(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), and folly::EventHandler::unregisterHandler().
TEST | ( | EventBaseTest | , |
ReadImmediate | |||
) |
Test registering for READ when the socket is immediately readable
Definition at line 277 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::bind(), folly::test::end(), handler(), ScheduledEvent::length, TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), folly::EventHandler::unregisterHandler(), and writeToFD().
TEST | ( | EventBaseTest | , |
WriteEvent | |||
) |
Test a WRITE event
Definition at line 326 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, and writeUntilFull().
TEST | ( | EventBaseTest | , |
WritePersist | |||
) |
Test (WRITE | PERSIST)
Definition at line 367 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::netops::bind(), folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), ScheduledEvent::result, scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), folly::EventHandler::unregisterHandler(), and writeUntilFull().
TEST | ( | EventBaseTest | , |
WriteImmediate | |||
) |
Test registering for WRITE when the socket is immediately writable
Definition at line 414 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::netops::bind(), folly::test::end(), handler(), int64_t, TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), and folly::EventHandler::unregisterHandler().
TEST | ( | EventBaseTest | , |
ReadWrite | |||
) |
Test (READ | WRITE) when the socket becomes readable first
Definition at line 461 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::test::end(), handler(), ScheduledEvent::length, TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, and writeUntilFull().
TEST | ( | EventBaseTest | , |
WriteRead | |||
) |
Test (READ | WRITE) when the socket becomes writable first
Definition at line 501 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), readUntilEmpty(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, and writeUntilFull().
TEST | ( | EventBaseTest | , |
ReadWriteSimultaneous | |||
) |
Test (READ | WRITE) when the socket becomes readable and writable at the same time.
Definition at line 548 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, and writeUntilFull().
TEST | ( | EventBaseTest | , |
ReadWritePersist | |||
) |
Test (READ | WRITE | PERSIST)
Definition at line 588 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GT, folly::netops::bind(), folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), readUntilEmpty(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), and folly::EventHandler::unregisterHandler().
TEST | ( | EventBaseTest | , |
ReadPartial | |||
) |
Test reading only part of the available data when a read event is fired. When PERSIST is used, make sure the handler gets notified again the next time around the loop.
Definition at line 669 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::bind(), folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), and folly::EventHandler::unregisterHandler().
TEST | ( | EventBaseTest | , |
WritePartial | |||
) |
Test writing without completely filling up the write buffer when the fd becomes writable. When PERSIST is used, make sure the handler gets notified again the next time around the loop.
Definition at line 733 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GE, folly::netops::bind(), folly::test::end(), handler(), TestHandler::log, folly::EventBase::loop(), folly::EventHandler::registerHandler(), scheduleEvents(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), folly::EventHandler::unregisterHandler(), and writeUntilFull().
TEST | ( | EventBaseTest | , |
DestroyHandler | |||
) |
Test destroying a registered EventHandler
Definition at line 779 of file EventBaseTest.cpp.
References ASSERT_GT, folly::netops::bind(), checkReadUntilEmpty(), folly::test::end(), h, handler(), folly::EventBase::loop(), folly::pushmi::__adl::noexcept(), readUntilEmpty(), folly::EventHandler::registerHandler(), start, T_CHECK_TIMEOUT, folly::TimeoutManager::tryRunAfterDelay(), and writeUntilFull().
TEST | ( | EventBaseTest | , |
RunAfterDelay | |||
) |
Definition at line 831 of file EventBaseTest.cpp.
References folly::netops::bind(), folly::test::end(), folly::EventBase::loop(), start, T_CHECK_TIMEOUT, and folly::TimeoutManager::tryRunAfterDelay().
TEST | ( | EventBaseTest | , |
RunAfterDelayDestruction | |||
) |
Test the behavior of tryRunAfterDelay() when some timeouts are still scheduled when the EventBase is destroyed.
Definition at line 855 of file EventBaseTest.cpp.
References ASSERT_TRUE, folly::netops::bind(), folly::test::end(), folly::TimePoint::isUnset(), folly::EventBase::loop(), folly::TimePoint::reset(), start, T_CHECK_TIMEOUT, and folly::TimeoutManager::tryRunAfterDelay().
TEST | ( | EventBaseTest | , |
BasicTimeouts | |||
) |
Definition at line 905 of file EventBaseTest.cpp.
References folly::test::end(), folly::EventBase::loop(), folly::AsyncTimeout::scheduleTimeout(), start, T_CHECK_TIMEOUT, and TestTimeout::timestamp.
TEST | ( | EventBaseTest | , |
ReuseTimeout | |||
) |
Test rescheduling the same timeout multiple times
Definition at line 957 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::test::end(), folly::EventBase::loop(), start, ReschedulingTimeout::start(), folly::pushmi::detail::t, T_CHECK_TIMEOUT, ReschedulingTimeout::timestamps, and uint32_t.
TEST | ( | EventBaseTest | , |
RescheduleTimeout | |||
) |
Test rescheduling a timeout before it has fired
Definition at line 989 of file EventBaseTest.cpp.
References folly::netops::bind(), folly::test::end(), f, folly::EventBase::loop(), folly::AsyncTimeout::scheduleTimeout(), start, T_CHECK_TIMEOUT, TestTimeout::timestamp, folly::TimeoutManager::tryRunAfterDelay(), and uint32_t.
TEST | ( | EventBaseTest | , |
CancelTimeout | |||
) |
Test cancelling a timeout
Definition at line 1021 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::bind(), folly::test::end(), folly::EventBase::loop(), start, ReschedulingTimeout::start(), folly::pushmi::detail::t, T_CHECK_TIMEOUT, ReschedulingTimeout::timestamps, and folly::TimeoutManager::tryRunAfterDelay().
TEST | ( | EventBaseTest | , |
DestroyTimeout | |||
) |
Test destroying a scheduled timeout object
Definition at line 1046 of file EventBaseTest.cpp.
References folly::test::end(), folly::EventBase::loop(), folly::pushmi::__adl::noexcept(), folly::AsyncTimeout::scheduleTimeout(), start, folly::pushmi::detail::t, and T_CHECK_TIMEOUT.
TEST | ( | EventBaseTest | , |
ScheduledFn | |||
) |
Test the scheduled executor impl
Definition at line 1078 of file EventBaseTest.cpp.
References folly::netops::bind(), folly::test::end(), folly::EventBase::loop(), folly::ScheduledExecutor::schedule(), start, and T_CHECK_TIMEOUT.
TEST | ( | EventBaseTest | , |
ScheduledFnAt | |||
) |
Definition at line 1098 of file EventBaseTest.cpp.
References folly::netops::bind(), folly::test::end(), folly::EventBase::loop(), folly::ScheduledExecutor::now(), folly::EventBase::scheduleAt(), start, T_CHECK_TIME_LT, and T_CHECK_TIMEOUT.
TEST | ( | EventBaseTest | , |
RunInThread | |||
) |
Definition at line 1160 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_LT, folly::netops::bind(), data, folly::test::end(), RunInThreadData::evb, folly::TimePoint::getTime(), i, folly::EventBase::loop(), RunInThreadData::opsPerThread, folly::EventBase::runInEventBaseThread(), runInThreadTestFunc(), SCOPE_EXIT, start, threads, folly::TimeoutManager::tryRunAfterDelay(), uint32_t, value, and RunInThreadData::values.
TEST | ( | EventBaseTest | , |
RunInEventBaseThreadAndWait | |||
) |
Definition at line 1226 of file EventBaseTest.cpp.
References c, EXPECT_EQ, i, folly::EventBase::loopForever(), folly::EventBase::runInEventBaseThreadAndWait(), sum(), folly::EventBase::terminateLoopSoon(), threads, and folly::EventBase::waitUntilRunning().
TEST | ( | EventBaseTest | , |
RunImmediatelyOrRunInEventBaseThreadAndWaitCross | |||
) |
Definition at line 1263 of file EventBaseTest.cpp.
References EXPECT_TRUE, folly::EventBase::runImmediatelyOrRunInEventBaseThreadAndWait(), SCOPE_EXIT, and folly::EventBase::terminateLoopSoon().
TEST | ( | EventBaseTest | , |
RunImmediatelyOrRunInEventBaseThreadAndWaitWithin | |||
) |
Definition at line 1275 of file EventBaseTest.cpp.
References EXPECT_TRUE, folly::EventBase::runImmediatelyOrRunInEventBaseThreadAndWait(), folly::EventBase::runInEventBaseThreadAndWait(), SCOPE_EXIT, and folly::EventBase::terminateLoopSoon().
TEST | ( | EventBaseTest | , |
RunImmediatelyOrRunInEventBaseThreadNotLooping | |||
) |
Definition at line 1289 of file EventBaseTest.cpp.
References EXPECT_TRUE, and folly::EventBase::runImmediatelyOrRunInEventBaseThreadAndWait().
TEST | ( | EventBaseTest | , |
RepeatedRunInLoop | |||
) |
Definition at line 1329 of file EventBaseTest.cpp.
References ASSERT_EQ, c, CountedLoopCallback::getCount(), folly::EventBase::loop(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
RunInLoopNoTimeMeasurement | |||
) |
Definition at line 1344 of file EventBaseTest.cpp.
References ASSERT_EQ, c, CountedLoopCallback::getCount(), folly::EventBase::loop(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
RunInLoopStopLoop | |||
) |
Definition at line 1359 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GE, ASSERT_LE, folly::netops::bind(), CountedLoopCallback::getCount(), folly::EventBase::loopForever(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
messageAvailableException | |||
) |
Definition at line 1387 of file EventBaseTest.cpp.
References folly::EventBase::loopForever(), folly::EventBase::runInEventBaseThread(), and folly::pushmi::detail::t.
TEST | ( | EventBaseTest | , |
TryRunningAfterTerminate | |||
) |
Definition at line 1402 of file EventBaseTest.cpp.
References ASSERT_FALSE, folly::netops::bind(), folly::EventBase::loopForever(), folly::EventBase::runInEventBaseThread(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
CancelRunInLoop | |||
) |
Definition at line 1415 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::bind(), CountedLoopCallback::getCount(), folly::EventBase::loop(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
LoopTermination | |||
) |
Test that EventBase::loop() correctly detects when there are no more events left to run.
This uses a single callback, which alternates registering itself as a loop callback versus a EventHandler callback. This exercises a regression where EventBase::loop() incorrectly exited if there were no more fd handlers registered, but a loop callback installed a new fd handler.
Definition at line 1534 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::close(), TerminateTestCallback::getEventInvocations(), TerminateTestCallback::getLoopInvocations(), folly::EventBase::loop(), pipe(), TerminateTestCallback::reset(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
IdleTime | |||
) |
Verify that idle time is correctly accounted for when decaying our loop time.
This works by creating a high loop time (via usleep), expecting a latency callback with known value, and then scheduling a timeout for later. This later timeout is far enough in the future that the idle time should have caused the loop time to decay.
Definition at line 1610 of file EventBaseTest.cpp.
References ASSERT_EQ, ASSERT_GE, ASSERT_LE, ASSERT_TRUE, count, EXPECT_EQ, EXPECT_GE, EXPECT_LE, FAIL, folly::EventBase::getAvgLoopTime(), IdleTimeTimeoutSeries::getTimeouts(), int64_t, folly::EventBase::loop(), folly::EventBase::loopOnce(), now(), folly::EventBase::resetLoadAvg(), folly::AsyncTimeout::scheduleTimeout(), folly::EventBase::setLoadAvgMsec(), folly::EventBase::setMaxLatency(), SKIP, and us.
TEST | ( | EventBaseTest | , |
ThisLoop | |||
) |
Test that thisLoop functionality works with terminateLoopSoon
Definition at line 1672 of file EventBaseTest.cpp.
References ASSERT_FALSE, ASSERT_TRUE, folly::EventBase::loopForever(), folly::EventBase::runInLoop(), and folly::EventBase::terminateLoopSoon().
TEST | ( | EventBaseTest | , |
EventBaseThreadLoop | |||
) |
Definition at line 1692 of file EventBaseTest.cpp.
References ASSERT_TRUE, folly::EventBase::loop(), and folly::EventBase::runInEventBaseThread().
TEST | ( | EventBaseTest | , |
EventBaseThreadName | |||
) |
Definition at line 1702 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::EventBase::loop(), name, and folly::EventBase::setName().
TEST | ( | EventBaseTest | , |
RunBeforeLoop | |||
) |
Definition at line 1714 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::EventBase::loopForever(), folly::EventBase::runBeforeLoop(), and folly::EventBase::terminateLoopSoon().
TEST | ( | EventBaseTest | , |
RunBeforeLoopWait | |||
) |
Definition at line 1722 of file EventBaseTest.cpp.
References ASSERT_EQ, CountedLoopCallback::getCount(), folly::EventBase::loopForever(), folly::EventBase::runBeforeLoop(), folly::EventBase::terminateLoopSoon(), and folly::TimeoutManager::tryRunAfterDelay().
TEST | ( | EventBaseTest | , |
StopBeforeLoop | |||
) |
Definition at line 1742 of file EventBaseTest.cpp.
References ASSERT_EQ, folly::netops::close(), handler(), folly::EventBase::loop(), pipe(), folly::EventHandler::registerHandler(), SUCCEED, folly::pushmi::detail::t, folly::EventBase::terminateLoopSoon(), and folly::EventHandler::unregisterHandler().
TEST | ( | EventBaseTest | , |
RunCallbacksOnDestruction | |||
) |
Definition at line 1765 of file EventBaseTest.cpp.
References ASSERT_TRUE, and folly::EventBase::runInEventBaseThread().
TEST | ( | EventBaseTest | , |
LoopKeepAlive | |||
) |
Definition at line 1776 of file EventBaseTest.cpp.
References ASSERT_TRUE, folly::getKeepAliveToken(), folly::EventBase::loop(), folly::gen::move, folly::EventBase::runInEventBaseThread(), and folly::pushmi::detail::t.
TEST | ( | EventBaseTest | , |
LoopKeepAliveInLoop | |||
) |
Definition at line 1794 of file EventBaseTest.cpp.
References ASSERT_TRUE, folly::getKeepAliveToken(), folly::EventBase::loop(), folly::gen::move, folly::EventBase::runInEventBaseThread(), and folly::pushmi::detail::t.
TEST | ( | EventBaseTest | , |
LoopKeepAliveWithLoopForever | |||
) |
Definition at line 1816 of file EventBaseTest.cpp.
References ASSERT_FALSE, ASSERT_TRUE, folly::getKeepAliveToken(), folly::EventBase::loopForever(), and folly::gen::move.
TEST | ( | EventBaseTest | , |
LoopKeepAliveShutdown | |||
) |
Definition at line 1844 of file EventBaseTest.cpp.
References ASSERT_TRUE, folly::getKeepAliveToken(), folly::gen::move, and folly::pushmi::detail::t.
TEST | ( | EventBaseTest | , |
LoopKeepAliveAtomic | |||
) |
Definition at line 1865 of file EventBaseTest.cpp.
References EXPECT_EQ, folly::getKeepAliveToken(), i, kNumThreads, folly::make_unique(), folly::gen::move, and folly::pushmi::detail::t.
TEST | ( | EventBaseTest | , |
LoopKeepAliveCast | |||
) |
Definition at line 1910 of file EventBaseTest.cpp.
References folly::getKeepAliveToken().
TEST | ( | EventBaseTest | , |
DrivableExecutorTest | |||
) |
Definition at line 1915 of file EventBaseTest.cpp.
References folly::EventBase::drive(), EXPECT_TRUE, f, folly::Promise< T >::getFuture(), folly::TimeoutManager::runAfterDelay(), folly::EventBase::runInEventBaseThread(), folly::Promise< T >::setValue(), and folly::pushmi::detail::t.
TEST | ( | EventBaseTest | , |
IOExecutorTest | |||
) |
Definition at line 1944 of file EventBaseTest.cpp.
References EXPECT_EQ, and folly::EventBase::getEventBase().
TEST | ( | EventBaseTest | , |
RequestContextTest | |||
) |
Definition at line 1951 of file EventBaseTest.cpp.
References context, EXPECT_EQ, EXPECT_NE, folly::pushmi::operators::get, folly::EventBase::loop(), and folly::EventBase::runInLoop().
TEST | ( | EventBaseTest | , |
CancelLoopCallbackRequestContextTest | |||
) |
Definition at line 1972 of file EventBaseTest.cpp.
References c, folly::EventBase::LoopCallback::cancelLoopCallback(), context, EXPECT_EQ, EXPECT_NE, folly::pushmi::operators::get, and folly::EventBase::runInLoop().
ssize_t writeToFD | ( | int | fd, |
size_t | length | ||
) |
Definition at line 57 of file EventBaseTest.cpp.
References fizz::detail::write().
Referenced by PartialWriteHandler::handlerReady(), ScheduledEvent::perform(), and TEST().
size_t writeUntilFull | ( | int | fd | ) |
Definition at line 67 of file EventBaseTest.cpp.
References BUF_SIZE, and fizz::detail::write().
Referenced by TestHandler::handlerReady(), ScheduledEvent::perform(), and TEST().