proxygen
|
#include <atomic>
#include <thread>
#include <vector>
#include <folly/Memory.h>
#include <folly/Random.h>
#include <folly/futures/Future.h>
#include <folly/Conv.h>
#include <folly/fibers/AddTasks.h>
#include <folly/fibers/AtomicBatchDispatcher.h>
#include <folly/fibers/BatchDispatcher.h>
#include <folly/fibers/EventBaseLoopController.h>
#include <folly/fibers/FiberManager.h>
#include <folly/fibers/FiberManagerMap.h>
#include <folly/fibers/GenericBaton.h>
#include <folly/fibers/Semaphore.h>
#include <folly/fibers/SimpleLoopController.h>
#include <folly/fibers/TimedMutex.h>
#include <folly/fibers/WhenN.h>
#include <folly/io/async/ScopedEventBaseThread.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Classes | |
struct | AtomicBatchDispatcherTesting::DevNullPiper |
struct | AtomicBatchDispatcherTesting::Job |
Namespaces | |
AtomicBatchDispatcherTesting | |
Macros | |
#define | ENABLE_TRACE_IN_TEST 0 |
#define | OUTPUT_TRACE devNullPiper |
#define | SET_UP_TEST_FUNC |
Typedefs | |
using | AtomicBatchDispatcherTesting::ValueT = size_t |
using | AtomicBatchDispatcherTesting::ResultT = std::string |
using | AtomicBatchDispatcherTesting::DispatchFunctionT = folly::Function< std::vector< ResultT >(std::vector< ValueT > &&)> |
Functions | |
TEST (FiberManager, batonTimedWaitTimeout) | |
TEST (FiberManager, batonTimedWaitPost) | |
TEST (FiberManager, batonTimedWaitTimeoutEvb) | |
TEST (FiberManager, batonTimedWaitPostEvb) | |
TEST (FiberManager, batonTryWait) | |
TEST (FiberManager, genericBatonFiberWait) | |
TEST (FiberManager, genericBatonThreadWait) | |
TEST (FiberManager, addTasksNoncopyable) | |
TEST (FiberManager, awaitThrow) | |
TEST (FiberManager, addTasksThrow) | |
TEST (FiberManager, addTasksVoid) | |
TEST (FiberManager, addTasksVoidThrow) | |
TEST (FiberManager, addTasksReserve) | |
TEST (FiberManager, addTaskDynamic) | |
TEST (FiberManager, forEach) | |
TEST (FiberManager, collectN) | |
TEST (FiberManager, collectNThrow) | |
TEST (FiberManager, collectNVoid) | |
TEST (FiberManager, collectNVoidThrow) | |
TEST (FiberManager, collectAll) | |
TEST (FiberManager, collectAllVoid) | |
TEST (FiberManager, collectAny) | |
TEST (FiberManager, runInMainContext) | |
TEST (FiberManager, addTaskFinally) | |
TEST (FiberManager, fibersPoolWithinLimit) | |
TEST (FiberManager, fibersPoolOverLimit) | |
TEST (FiberManager, remoteFiberBasic) | |
TEST (FiberManager, addTaskRemoteBasic) | |
TEST (FiberManager, remoteHasTasks) | |
TEST (FiberManager, remoteHasReadyTasks) | |
template<typename Data > | |
void | testFiberLocal () |
TEST (FiberManager, fiberLocal) | |
TEST (FiberManager, fiberLocalHeap) | |
TEST (FiberManager, fiberLocalDestructor) | |
TEST (FiberManager, yieldTest) | |
TEST (FiberManager, RequestContext) | |
TEST (FiberManager, resizePeriodically) | |
TEST (FiberManager, batonWaitTimeoutHandler) | |
TEST (FiberManager, batonWaitTimeoutMany) | |
TEST (FiberManager, remoteFutureTest) | |
TEST (FiberManager, remoteFutureVoidUnitTest) | |
TEST (FiberManager, nestedFiberManagers) | |
TEST (FiberManager, semaphore) | |
template<typename ExecutorT > | |
void | singleBatchDispatch (ExecutorT &executor, int batchSize, int index) |
TEST (FiberManager, batchDispatchTest) | |
template<typename ExecutorT > | |
folly::Future< std::vector< std::string > > | doubleBatchInnerDispatch (ExecutorT &executor, int totalNumberOfElements, std::vector< int > input) |
template<typename ExecutorT > | |
void | doubleBatchOuterDispatch (ExecutorT &executor, int totalNumberOfElements, int index) |
TEST (FiberManager, doubleBatchDispatchTest) | |
template<typename ExecutorT > | |
void | batchDispatchExceptionHandling (ExecutorT &executor, int i) |
TEST (FiberManager, batchDispatchExceptionHandlingTest) | |
ResultT | AtomicBatchDispatcherTesting::processSingleInput (ValueT &&input) |
std::vector< ResultT > | AtomicBatchDispatcherTesting::userDispatchFunc (std::vector< ValueT > &&inputs) |
void | AtomicBatchDispatcherTesting::createJobs (AtomicBatchDispatcher< ValueT, ResultT > &atomicBatchDispatcher, std::vector< Job > &jobs, size_t count) |
void | AtomicBatchDispatcherTesting::dispatchJobs (FiberManager &executor, std::vector< Job > &jobs, std::vector< folly::Optional< folly::Future< ResultT >>> &results, DispatchProblem dispatchProblem=DispatchProblem::None, size_t problemIndex=size_t(-1)) |
void | AtomicBatchDispatcherTesting::validateResult (std::vector< folly::Optional< folly::Future< ResultT >>> &results, size_t i) |
template<typename TException > | |
void | AtomicBatchDispatcherTesting::validateResults (std::vector< folly::Optional< folly::Future< ResultT >>> &results, size_t expectedNumResults) |
TEST (FiberManager, ABD_Test) | |
TEST (FiberManager, ABD_DispatcherDestroyedBeforeCallingCommit) | |
TEST (FiberManager, ABD_PreprocessingFailureTest) | |
TEST (FiberManager, ABD_MultipleDispatchOnSameTokenErrorTest) | |
TEST (FiberManager, ABD_GetTokenCalledAfterCommitTest) | |
TEST (FiberManager, ABD_UserProvidedBatchDispatchThrowsTest) | |
TEST (FiberManager, VirtualEventBase) | |
TEST (TimedMutex, ThreadsAndFibersDontDeadlock) | |
TEST (TimedMutex, ThreadFiberDeadlockOrder) | |
TEST (TimedMutex, ThreadFiberDeadlockRace) | |
TEST (FiberManager, highWaterMarkViaRecordStackEvery) | |
TEST (FiberManager, highWaterMarkViaRecordCurrentPosition) | |
Variables | |
struct AtomicBatchDispatcherTesting::DevNullPiper | AtomicBatchDispatcherTesting::devNullPiper |
#define ENABLE_TRACE_IN_TEST 0 |
Definition at line 1773 of file FibersTest.cpp.
#define OUTPUT_TRACE devNullPiper |
Definition at line 1787 of file FibersTest.cpp.
Referenced by AtomicBatchDispatcherTesting::dispatchJobs(), and AtomicBatchDispatcherTesting::validateResult().
#define SET_UP_TEST_FUNC |
Definition at line 1930 of file FibersTest.cpp.
Referenced by TEST().
void batchDispatchExceptionHandling | ( | ExecutorT & | executor, |
int | i | ||
) |
Definition at line 1742 of file FibersTest.cpp.
References EXPECT_THROW.
Referenced by TEST().
folly::Future<std::vector<std::string> > doubleBatchInnerDispatch | ( | ExecutorT & | executor, |
int | totalNumberOfElements, | ||
std::vector< int > | input | ||
) |
Definition at line 1651 of file FibersTest.cpp.
References folly::fibers::BatchDispatcher< ValueT, ResultT, ExecutorT >::add(), folly::gen::batch(), EXPECT_EQ, folly::gen::move, and folly::unit.
Referenced by doubleBatchOuterDispatch().
void doubleBatchOuterDispatch | ( | ExecutorT & | executor, |
int | totalNumberOfElements, | ||
int | index | ||
) |
Batch values in groups of 5, and then call inner dispatch.
Definition at line 1681 of file FibersTest.cpp.
References folly::fibers::BatchDispatcher< ValueT, ResultT, ExecutorT >::add(), folly::gen::batch(), folly::collectAllSemiFuture(), doubleBatchInnerDispatch(), EXPECT_EQ, group, folly::gen::move, and folly::unit.
Referenced by TEST().
void singleBatchDispatch | ( | ExecutorT & | executor, |
int | batchSize, | ||
int | index | ||
) |
Definition at line 1609 of file FibersTest.cpp.
References folly::fibers::BatchDispatcher< ValueT, ResultT, ExecutorT >::add(), folly::gen::batch(), EXPECT_EQ, and folly::gen::move.
Referenced by TEST().
TEST | ( | FiberManager | , |
batonTimedWaitTimeout | |||
) |
Definition at line 43 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, EXPECT_FALSE, folly::fibers::FiberManager::loopController(), folly::gen::move, now(), and folly::fibers::Baton::try_wait_for().
TEST | ( | FiberManager | , |
batonTimedWaitPost | |||
) |
Definition at line 86 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::loopController(), folly::gen::move, folly::fibers::Baton::post(), and folly::fibers::Baton::try_wait_for().
TEST | ( | FiberManager | , |
batonTimedWaitTimeoutEvb | |||
) |
Definition at line 121 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, EXPECT_FALSE, EXPECT_GT, EXPECT_LT, folly::fibers::FiberManager::loopController(), folly::EventBase::loopForever(), now(), folly::EventBase::runInEventBaseThread(), start, folly::EventBase::terminateLoopSoon(), and folly::fibers::Baton::try_wait_for().
TEST | ( | FiberManager | , |
batonTimedWaitPostEvb | |||
) |
Definition at line 160 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::loopController(), folly::EventBase::loopForever(), now(), folly::fibers::Baton::post(), folly::EventBase::runInEventBaseThread(), start, folly::EventBase::terminateLoopSoon(), folly::fibers::Baton::try_wait_for(), and folly::TimeoutManager::tryRunAfterDelay().
TEST | ( | FiberManager | , |
batonTryWait | |||
) |
Definition at line 197 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), b, c, EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::loopUntilNoReady(), folly::fibers::Baton::post(), and folly::fibers::Baton::try_wait().
TEST | ( | FiberManager | , |
genericBatonFiberWait | |||
) |
Definition at line 230 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), b, EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, folly::fibers::FiberManager::hasActiveFiber(), folly::fibers::FiberManager::loopUntilNoReady(), folly::fibers::Baton::post(), and folly::fibers::Baton::wait().
TEST | ( | FiberManager | , |
genericBatonThreadWait | |||
) |
Definition at line 259 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), b, EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::hasActiveFiber(), folly::fibers::FiberManager::loopUntilNoReady(), folly::fibers::Baton::post(), and folly::fibers::Baton::wait().
TEST | ( | FiberManager | , |
addTasksNoncopyable | |||
) |
Definition at line 286 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTasks(), folly::fibers::await(), EXPECT_EQ, EXPECT_GE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
awaitThrow | |||
) |
Definition at line 330 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskFuture(), folly::fibers::await(), EXPECT_THROW, folly::fibers::getFiberManager(), folly::gen::move, folly::EventBase::runInEventBaseThread(), and folly::fibers::Promise< T, BatonT >::setValue().
TEST | ( | FiberManager | , |
addTasksThrow | |||
) |
Definition at line 353 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTasks(), folly::fibers::await(), EXPECT_EQ, EXPECT_GE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
addTasksVoid | |||
) |
Definition at line 405 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTasks(), folly::fibers::await(), EXPECT_EQ, EXPECT_GE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
addTasksVoidThrow | |||
) |
Definition at line 447 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTasks(), folly::fibers::await(), EXPECT_EQ, EXPECT_GE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
addTasksReserve | |||
) |
Definition at line 497 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTasks(), folly::fibers::await(), EXPECT_FALSE, EXPECT_TRUE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
addTaskDynamic | |||
) |
Definition at line 551 of file FibersTest.cpp.
References folly::fibers::TaskIterator< T >::addTask(), folly::fibers::FiberManager::addTaskFuture(), folly::fibers::TaskIterator< T >::awaitNext(), EXPECT_EQ, folly::fibers::getFiberManager(), folly::fibers::Baton::post(), and folly::fibers::Baton::wait().
TEST | ( | FiberManager | , |
forEach | |||
) |
Definition at line 587 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), EXPECT_EQ, EXPECT_TRUE, folly::gen::first, folly::fibers::forEach(), i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectN | |||
) |
Definition at line 630 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectN(), EXPECT_EQ, folly::gen::first, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectNThrow | |||
) |
Definition at line 670 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectN(), EXPECT_EQ, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectNVoid | |||
) |
Definition at line 709 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectN(), EXPECT_EQ, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectNVoidThrow | |||
) |
Definition at line 745 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectN(), EXPECT_EQ, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectAll | |||
) |
Definition at line 784 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectAll(), EXPECT_EQ, EXPECT_TRUE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectAllVoid | |||
) |
Definition at line 823 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectAll(), EXPECT_TRUE, i, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
collectAny | |||
) |
Definition at line 858 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), folly::fibers::collectAny(), EXPECT_EQ, EXPECT_FALSE, EXPECT_GT, EXPECT_LT, i, folly::kIsSanitizeAddress, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
runInMainContext | |||
) |
Definition at line 927 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::loopController(), folly::fibers::FiberManager::runInMainContext(), folly::fibers::runInMainContext(), and folly::value().
TEST | ( | FiberManager | , |
addTaskFinally | |||
) |
Definition at line 963 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskFinally(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, and folly::fibers::FiberManager::loopController().
TEST | ( | FiberManager | , |
fibersPoolWithinLimit | |||
) |
Definition at line 987 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, folly::fibers::FiberManager::fibersAllocated(), folly::fibers::FiberManager::fibersPoolSize(), i, folly::fibers::FiberManager::loopController(), and folly::fibers::FiberManager::Options::maxFibersPoolSize.
TEST | ( | FiberManager | , |
fibersPoolOverLimit | |||
) |
Definition at line 1016 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, folly::fibers::FiberManager::fibersAllocated(), folly::fibers::FiberManager::fibersPoolSize(), i, folly::fibers::FiberManager::loopController(), and folly::fibers::FiberManager::Options::maxFibersPoolSize.
TEST | ( | FiberManager | , |
remoteFiberBasic | |||
) |
Definition at line 1041 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::await(), EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::loopController(), folly::fibers::FiberManager::loopUntilNoReady(), and folly::gen::move.
TEST | ( | FiberManager | , |
addTaskRemoteBasic | |||
) |
Definition at line 1079 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskRemote(), folly::fibers::await(), EXPECT_EQ, EXPECT_TRUE, folly::fibers::FiberManager::loopUntilNoReady(), and folly::gen::move.
TEST | ( | FiberManager | , |
remoteHasTasks | |||
) |
Definition at line 1119 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskRemote(), counter, EXPECT_EQ, EXPECT_FALSE, folly::fibers::FiberManager::hasTasks(), and folly::fibers::FiberManager::loopUntilNoReady().
TEST | ( | FiberManager | , |
remoteHasReadyTasks | |||
) |
Definition at line 1134 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskRemote(), folly::fibers::await(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, folly::fibers::FiberManager::hasTasks(), folly::fibers::FiberManager::loopUntilNoReady(), and folly::gen::move.
TEST | ( | FiberManager | , |
fiberLocal | |||
) |
TEST | ( | FiberManager | , |
fiberLocalHeap | |||
) |
TEST | ( | FiberManager | , |
fiberLocalDestructor | |||
) |
Definition at line 1223 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTask(), folly::data(), EXPECT_EQ, EXPECT_FALSE, folly::fibers::FiberManager::hasTasks(), and folly::fibers::FiberManager::loopUntilNoReady().
TEST | ( | FiberManager | , |
yieldTest | |||
) |
Definition at line 1247 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_TRUE, folly::fibers::FiberManager::loopController(), and folly::fibers::FiberManager::yield().
TEST | ( | FiberManager | , |
RequestContext | |||
) |
Definition at line 1268 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::FiberManager::addTaskFinally(), folly::fibers::FiberManager::addTaskRemote(), EXPECT_EQ, EXPECT_TRUE, folly::RequestContext::get(), folly::fibers::FiberManager::loopUntilNoReady(), folly::fibers::Baton::post(), folly::fibers::runInMainContext(), folly::RequestContext::setContext(), and folly::fibers::Baton::wait().
TEST | ( | FiberManager | , |
resizePeriodically | |||
) |
Definition at line 1362 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, folly::fibers::FiberManager::fibersAllocated(), folly::fibers::FiberManager::Options::fibersPoolResizePeriodMs, folly::fibers::FiberManager::fibersPoolSize(), i, folly::fibers::FiberManager::loopController(), folly::EventBase::loopOnce(), and folly::fibers::FiberManager::Options::maxFibersPoolSize.
TEST | ( | FiberManager | , |
batonWaitTimeoutHandler | |||
) |
Definition at line 1424 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, EXPECT_FALSE, folly::fibers::FiberManager::loopController(), folly::EventBase::loopOnce(), folly::fibers::FiberManager::loopUntilNoReady(), folly::fibers::Baton::TimeoutHandler::scheduleTimeout(), folly::fibers::Baton::try_wait(), and folly::fibers::Baton::wait().
TEST | ( | FiberManager | , |
batonWaitTimeoutMany | |||
) |
Definition at line 1456 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTask(), i, folly::fibers::FiberManager::loopController(), folly::EventBase::loopForever(), folly::fibers::Baton::TimeoutHandler::scheduleTimeout(), folly::EventBase::terminateLoopSoon(), and folly::fibers::Baton::wait().
TEST | ( | FiberManager | , |
remoteFutureTest | |||
) |
Definition at line 1486 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskFuture(), folly::fibers::FiberManager::addTaskRemoteFuture(), EXPECT_EQ, folly::fibers::FiberManager::loopController(), and folly::gen::move.
TEST | ( | FiberManager | , |
remoteFutureVoidUnitTest | |||
) |
Definition at line 1504 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskFuture(), folly::fibers::FiberManager::addTaskRemoteFuture(), ASSERT_TRUE, folly::fibers::FiberManager::loopController(), and folly::Future< T >::wait().
TEST | ( | FiberManager | , |
nestedFiberManagers | |||
) |
Definition at line 1526 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), EXPECT_EQ, folly::fibers::getFiberManager(), folly::fibers::FiberManager::getFiberManagerUnsafe(), folly::EventBase::loopForever(), folly::fibers::runInMainContext(), and folly::EventBase::terminateLoopSoon().
TEST | ( | FiberManager | , |
semaphore | |||
) |
Definition at line 1554 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), counter, evb_, EXPECT_GE, EXPECT_LT, i, folly::fibers::FiberManager::loopController(), folly::EventBase::loopForever(), folly::fibers::Baton::post(), folly::fibers::Semaphore::signal(), folly::EventBase::terminateLoopSoon(), and folly::fibers::Semaphore::wait().
TEST | ( | FiberManager | , |
batchDispatchTest | |||
) |
Definition at line 1625 of file FibersTest.cpp.
References folly::pushmi::executor, folly::fibers::getFiberManager(), i, folly::EventBase::loop(), and singleBatchDispatch().
TEST | ( | FiberManager | , |
doubleBatchDispatchTest | |||
) |
Definition at line 1725 of file FibersTest.cpp.
References doubleBatchOuterDispatch(), folly::pushmi::executor, folly::fibers::getFiberManager(), i, and folly::EventBase::loop().
TEST | ( | FiberManager | , |
batchDispatchExceptionHandlingTest | |||
) |
Definition at line 1751 of file FibersTest.cpp.
References batchDispatchExceptionHandling(), folly::pushmi::executor, folly::fibers::getFiberManager(), i, and folly::EventBase::loop().
TEST | ( | FiberManager | , |
ABD_Test | |||
) |
Definition at line 1941 of file FibersTest.cpp.
References folly::fibers::createAtomicBatchDispatcher(), AtomicBatchDispatcherTesting::createJobs(), AtomicBatchDispatcherTesting::dispatchJobs(), folly::pushmi::executor, folly::gen::move, SET_UP_TEST_FUNC, AtomicBatchDispatcherTesting::userDispatchFunc(), and AtomicBatchDispatcherTesting::validateResults().
TEST | ( | FiberManager | , |
ABD_DispatcherDestroyedBeforeCallingCommit | |||
) |
Definition at line 1957 of file FibersTest.cpp.
References folly::fibers::createAtomicBatchDispatcher(), AtomicBatchDispatcherTesting::createJobs(), AtomicBatchDispatcherTesting::dispatchJobs(), folly::pushmi::executor, folly::gen::move, SET_UP_TEST_FUNC, and AtomicBatchDispatcherTesting::userDispatchFunc().
TEST | ( | FiberManager | , |
ABD_PreprocessingFailureTest | |||
) |
Definition at line 1982 of file FibersTest.cpp.
References folly::fibers::createAtomicBatchDispatcher(), AtomicBatchDispatcherTesting::createJobs(), AtomicBatchDispatcherTesting::dispatchJobs(), folly::pushmi::executor, folly::gen::move, SET_UP_TEST_FUNC, and AtomicBatchDispatcherTesting::userDispatchFunc().
TEST | ( | FiberManager | , |
ABD_MultipleDispatchOnSameTokenErrorTest | |||
) |
Definition at line 1998 of file FibersTest.cpp.
References folly::fibers::createAtomicBatchDispatcher(), AtomicBatchDispatcherTesting::createJobs(), AtomicBatchDispatcherTesting::dispatchJobs(), folly::pushmi::executor, folly::gen::move, SET_UP_TEST_FUNC, and AtomicBatchDispatcherTesting::userDispatchFunc().
TEST | ( | FiberManager | , |
ABD_GetTokenCalledAfterCommitTest | |||
) |
Definition at line 2013 of file FibersTest.cpp.
References folly::fibers::createAtomicBatchDispatcher(), AtomicBatchDispatcherTesting::createJobs(), AtomicBatchDispatcherTesting::dispatchJobs(), folly::pushmi::executor, EXPECT_THROW, folly::gen::move, SET_UP_TEST_FUNC, AtomicBatchDispatcherTesting::userDispatchFunc(), and AtomicBatchDispatcherTesting::validateResults().
TEST | ( | FiberManager | , |
ABD_UserProvidedBatchDispatchThrowsTest | |||
) |
Definition at line 2032 of file FibersTest.cpp.
References folly::fibers::createAtomicBatchDispatcher(), AtomicBatchDispatcherTesting::createJobs(), AtomicBatchDispatcherTesting::dispatchJobs(), folly::pushmi::executor, folly::gen::move, SET_UP_TEST_FUNC, and AtomicBatchDispatcherTesting::userDispatchFunc().
TEST | ( | FiberManager | , |
VirtualEventBase | |||
) |
Definition at line 2051 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTaskRemote(), EXPECT_FALSE, EXPECT_TRUE, folly::ScopedEventBaseThread::getEventBase(), folly::fibers::getFiberManager(), folly::EventBase::getVirtualEventBase(), and folly::fibers::Baton::try_wait_for().
TEST | ( | TimedMutex | , |
ThreadsAndFibersDontDeadlock | |||
) |
Definition at line 2085 of file FibersTest.cpp.
References b, EXPECT_EQ, folly::fibers::getFiberManager(), i, folly::fibers::TimedMutex::lock(), folly::EventBase::loop(), mutex, folly::fibers::Baton::try_wait_for(), and folly::fibers::TimedMutex::unlock().
TEST | ( | TimedMutex | , |
ThreadFiberDeadlockOrder | |||
) |
Definition at line 2122 of file FibersTest.cpp.
References EXPECT_EQ, EXPECT_TRUE, folly::fibers::getFiberManager(), folly::fibers::TimedMutex::lock(), folly::EventBase::loopOnce(), mutex, folly::fibers::runInMainContext(), folly::fibers::TimedMutex::timed_lock(), and folly::fibers::TimedMutex::unlock().
TEST | ( | TimedMutex | , |
ThreadFiberDeadlockRace | |||
) |
Definition at line 2151 of file FibersTest.cpp.
References EXPECT_EQ, EXPECT_LT, EXPECT_NE, EXPECT_TRUE, folly::fibers::getFiberManager(), folly::fibers::TimedMutex::lock(), folly::EventBase::loopOnce(), mutex, folly::fibers::runInMainContext(), folly::fibers::TimedMutex::timed_lock(), and folly::fibers::TimedMutex::unlock().
TEST | ( | FiberManager | , |
highWaterMarkViaRecordStackEvery | |||
) |
Test that we can properly track fiber stack usage, via recordStackEvery For ASAN builds, it is not recorded.
Definition at line 2202 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), b, f, i, folly::fibers::FiberManager::loopController(), folly::fibers::FiberManager::Options::recordStackEvery, s, and folly::fibers::FiberManager::stackHighWatermark().
TEST | ( | FiberManager | , |
highWaterMarkViaRecordCurrentPosition | |||
) |
Test that we can properly track fiber stack usage, via current position estimate. For ASAN builds, it is not recorded.
Definition at line 2235 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), b, f, i, folly::fibers::FiberManager::loopController(), folly::fibers::FiberManager::runInMainContext(), s, and folly::fibers::FiberManager::stackHighWatermark().
void testFiberLocal | ( | ) |
Definition at line 1163 of file FibersTest.cpp.
References folly::fibers::FiberManager::addTask(), folly::fibers::addTask(), folly::fibers::FiberManager::addTaskRemote(), folly::fibers::collectAny(), EXPECT_EQ, EXPECT_FALSE, folly::fibers::FiberManager::hasTasks(), folly::fibers::FiberManager::loopUntilNoReady(), tasks, and folly::value().