proxygen
|
#include <folly/Singleton.h>
#include <folly/executors/ManualExecutor.h>
#include <folly/futures/Future.h>
#include <folly/futures/ThreadWheelTimekeeper.h>
#include <folly/portability/GTest.h>
Go to the source code of this file.
Classes | |
struct | TimekeeperFixture |
Functions | |
std::chrono::milliseconds const | zero_ms (0) |
std::chrono::milliseconds const | one_ms (1) |
std::chrono::milliseconds const | awhile (10) |
std::chrono::seconds const | too_long (10) |
std::chrono::steady_clock::time_point | now () |
TEST_F (TimekeeperFixture, after) | |
TEST (Timekeeper, futureGet) | |
TEST (Timekeeper, futureGetBeforeTimeout) | |
TEST (Timekeeper, futureGetTimeout) | |
TEST (Timekeeper, futureSleep) | |
TEST (Timekeeper, futureSleepHandlesNullTimekeeperSingleton) | |
TEST (Timekeeper, futureWithinHandlesNullTimekeeperSingleton) | |
TEST (Timekeeper, semiFutureWithinHandlesNullTimekeeperSingleton) | |
TEST (Timekeeper, futureDelayed) | |
TEST (Timekeeper, semiFutureDelayed) | |
TEST (Timekeeper, futureDelayedUnsafe) | |
TEST (Timekeeper, futureDelayedStickyExecutor) | |
TEST (Timekeeper, futureWithinThrows) | |
TEST (Timekeeper, semiFutureWithinThrows) | |
TEST (Timekeeper, futureWithinAlreadyComplete) | |
TEST (Timekeeper, semiFutureWithinAlreadyComplete) | |
TEST (Timekeeper, futureWithinFinishesInTime) | |
TEST (Timekeeper, semiFutureWithinFinishesInTime) | |
TEST (Timekeeper, futureWithinVoidSpecialization) | |
TEST (Timekeeper, semiFutureWithinVoidSpecialization) | |
TEST (Timekeeper, futureWithinException) | |
TEST (Timekeeper, semiFutureWithinException) | |
TEST (Timekeeper, onTimeout) | |
TEST (Timekeeper, onTimeoutComplete) | |
TEST (Timekeeper, onTimeoutReturnsFuture) | |
TEST (Timekeeper, onTimeoutVoid) | |
TEST (Timekeeper, interruptDoesntCrash) | |
TEST (Timekeeper, chainedInterruptTest) | |
TEST (Timekeeper, futureWithinChainedInterruptTest) | |
TEST (Timekeeper, semiFutureWithinChainedInterruptTest) | |
TEST (Timekeeper, executor) | |
TEST_F (TimekeeperFixture, atBeforeNow) | |
TEST_F (TimekeeperFixture, howToCastDuration) | |
TEST_F (TimekeeperFixture, destruction) | |
std::chrono::steady_clock::time_point now | ( | ) |
Definition at line 31 of file TimekeeperTest.cpp.
Referenced by folly::addBenchmark(), folly::FunctionScheduler::addFunctionToHeap(), folly::BucketedTimeSeries< VT, CT >::addValueAggregated(), folly::MultiLevelTimeSeries< VT, CT >::addValueAggregated(), folly::pushmi::any_time_executor_ref< E, TP >::any_time_executor_ref(), folly::asm_rdtsc(), folly::Timekeeper::at(), basic_test(), folly::BenchmarkSuspender::BenchmarkSuspender(), folly::detail::BufferedStat< DigestT, ClockT >::BufferedStat(), folly::EventBase::bumpHandlingTime(), TryWriteUntilCaller< Q, Clock, Duration >::callWrite(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::canEnqueue(), folly::logging::IntervalRateLimiter::checkSlow(), folly::AsyncSocket::connect(), wangle::Acceptor::connectionAccepted(), folly::MultiLevelTimeSeries< VT, CT >::count(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::deadline(), folly::BasicDynamicTokenBucket< Clock >::defaultClockNow(), deterministicAtomicWaitUntilTests(), folly::detail::BufferedStat< DigestT, ClockT >::doUpdate(), duration_to_ts(), folly::custom_stop_watch< Clock, Duration >::elapsed(), estimateQuantile(), folly::test::fc_test(), TestAsyncTransport::fireNextReadEvent(), wangle::FizzAcceptorHandshakeHelper::fizzHandshakeError(), wangle::FizzAcceptorHandshakeHelper::fizzHandshakeSuccess(), folly::detail::BufferedStat< DigestT, ClockT >::flush(), funcHasDuration(), folly::detail::MemoryIdler::futexWaitPreIdle(), fizz::sm::generateTicket(), folly::UnboundedQueue< T, false, 6 >::getAllocNextSegment(), fizz::client::test::ClientProtocolTest::getCachedPsk(), fizz::sm::getClockSkew(), proxygen::getCurrentTime(), TestTimeoutDelayed::getCurTime(), folly::HHWheelTimer::Callback::getCurTime(), folly::HHWheelTimer::getCurTime(), proxygen::getDateTimeStr(), fizz::sm::getMaxEarlyDataSize(), folly::ThreadPoolExecutor::getPoolStats(), fizz::sm::getPskExtension(), wangle::SSLSessionPersistentCacheBase< K >::getSSLSession(), folly::getTimeDelta(), testing::internal::GetTimeInMillis(), proxygen::AsyncTimeoutSet::Callback::getTimeRemaining(), folly::HHWheelTimer::Callback::getTimeRemaining(), folly::detail::MemoryIdler::getVariationTimeout(), folly::AsyncServerSocket::handlerReady(), wangle::SSLAcceptorHandshakeHelper::handshakeErr(), wangle::FizzAcceptorHandshakeHelper::handshakeErr(), wangle::SSLAcceptorHandshakeHelper::handshakeSuc(), wangle::FizzAcceptorHandshakeHelper::handshakeSuc(), intervalTest(), folly::AsyncSSLSocket::invalidState(), folly::AsyncSocket::invalidState(), folly::AsyncSocket::invokeConnectErr(), folly::AsyncSocket::invokeConnectSuccess(), folly::AsyncSSLSocket::invokeHandshakeCB(), folly::AsyncSSLSocket::invokeHandshakeErr(), folly::custom_stop_watch< Clock, Duration >::lap(), liveClockWaitUntilTests(), folly::AutoTimer< Logger, Clock >::log(), folly::AutoTimer< Logger, Clock >::logFormat(), folly::AutoTimer< Logger, Clock >::logImpl(), folly::LogMessage::LogMessage(), folly::EventBase::loopBody(), merge(), FreeDigest::merge(), mergeDigests(), proxygen::millisecondsSinceEpoch(), move_test(), multiAttemptExpectDurationWithin(), TestAsyncTransport::WriteEvent::newEvent(), wangle::SSLSessionPersistentCacheBase< K >::TimeUtil::now(), folly::ScheduledExecutor::now(), folly::chrono::coarse_steady_clock::now(), folly::pushmi::detail::submit_after_fn::fn< D, AN >::operator()(), folly::pushmi::systemNowF::operator()(), folly::pushmi::passDNF::operator()(), folly::pushmi::detail::now_fn::impl::operator()(), folly::Codel::overloaded(), folly::ParkingLot< Data >::park_for(), std::chrono::PrintTo(), producer_consumer_test(), wangle::LRUPersistentCache< K, V, MutexT >::put(), folly::TimeseriesHistogram< T, CT, C >::rate(), folly::BucketedTimeSeries< VT, CT >::rateHelper(), ReadStats::ReadStats(), folly::fibers::TimeoutController::registerTimeout(), folly::BenchmarkSuspender::rehire(), folly::TimePoint::reset(), ConcurrentFlowSingleSender::reset(), ConcurrentFlowManySender::reset(), folly::custom_stop_watch< Clock, Duration >::reset(), folly::FunctionScheduler::resetFunctionTimer(), folly::rcu_domain< Tag >::retire(), folly::FunctionScheduler::run(), run_basic_test(), folly::test::run_basic_timed_wait_tests(), run_multi_poster_multi_waiter_test(), run_once(), run_steady_clock_test(), run_system_clock_test(), folly::test::run_timed_wait_regular_test(), folly::test::run_timed_wait_tmo_tests(), runAllAndValidate(), folly::runBenchmarkGetNSPerIteration(), runElementTypeTest(), runFailingTryTimeoutTest(), runFairness(), runNeverFailUntilThread(), folly::ThreadPoolExecutor::runTask(), runTimeoutInPastTest(), folly::fibers::TimeoutController::runTimeouts(), proxygen::secondsSinceEpoch(), fizz::server::test::MockTicketCipher::setDefaults(), fizz::client::test::SynchronizedLruPskCacheTest::SetUp(), PeekingAcceptorHandshakeHelperTest::SetUp(), testing::internal::ShouldRunTestCase(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::shouldTimeOut(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitUntilDeadline< Clock, Duration >::shouldTimeOut(), ReadStats::shouldWriterStop(), folly::detail::distributed_mutex::spin(), folly::detail::spin_pause_until(), folly::detail::spin_yield_until(), folly::AsyncSSLSocket::sslAccept(), folly::FunctionScheduler::start(), TestAsyncTransport::startReadEvents(), folly::AsyncSSLSocket::startSSLConnect(), folly::BenchmarkSuspender::tally(), folly::ThreadPoolExecutor::Task::Task(), TEST(), test(), TEST_F(), fizz::server::test::TEST_F(), testTimeout(), folly::detail::time_point_conv(), time_single_sender_test(), folly::fibers::EventBaseLoopController::timedSchedule(), folly::fibers::Baton::timedWaitThread(), timeout_test(), proxygen::AsyncTimeoutSet::timeoutExpired(), folly::TimeoutQueue::TimeoutQueue(), wangle::AcceptorHandshakeManager::timeSinceAcceptMs(), folly::pushmi::inline_time_executor_t::top(), inline_time_executor::top(), proxygen::toSystemTimePoint(), folly::UnboundedQueue< T, false, 6 >::try_dequeue_for(), MPMC< T >::try_dequeue_for(), MPMC< T >::try_enqueue_for(), folly::detail::distributed_mutex::DistributedMutex< Atomic, TimePublishing >::try_lock_for(), folly::hazptr_domain< DeterministicAtomic >::try_timed_cleanup(), folly::SaturatingSemaphore< true, Atom >::try_wait_for(), folly::Baton< MayBlock, Atom >::try_wait_for(), folly::detail::LifoSemBase< BatonType, Atom >::try_wait_for(), folly::fibers::Baton::try_wait_until(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::tryEnqueueForImpl(), folly::BucketedTimeSeries< VT, CT >::update(), folly::BucketedTimeSeries< VT, CT >::updateBuckets(), fizz::sm::validatePsk(), folly::SemiFuture< T >::wait(), folly::ThreadedRepeatingFunctionRunner::waitFor(), folly::futures::detail::waitViaImpl(), folly::pushmi::time_source_shared< E, time_point >::worker(), TestAsyncTransport::writesAllowed(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::writeWithPriority(), and folly::detail::BufferedStat< folly::TDigest, ClockT >::~BufferedStat().
std::chrono::milliseconds const one_ms | ( | 1 | ) |
Referenced by TEST().
TEST | ( | Timekeeper | , |
futureGet | |||
) |
Definition at line 51 of file TimekeeperTest.cpp.
References EXPECT_EQ, folly::Promise< T >::getFuture(), folly::Promise< T >::setValue(), and folly::pushmi::detail::t.
TEST | ( | Timekeeper | , |
futureGetBeforeTimeout | |||
) |
Definition at line 58 of file TimekeeperTest.cpp.
References EXPECT_EQ, folly::Promise< T >::getFuture(), folly::Promise< T >::setValue(), and folly::pushmi::detail::t.
TEST | ( | Timekeeper | , |
futureGetTimeout | |||
) |
Definition at line 71 of file TimekeeperTest.cpp.
References EXPECT_THROW, folly::Promise< T >::getFuture(), and one_ms().
TEST | ( | Timekeeper | , |
futureSleep | |||
) |
Definition at line 76 of file TimekeeperTest.cpp.
References EXPECT_GE, now(), one_ms(), and folly::futures::sleep().
TEST | ( | Timekeeper | , |
futureSleepHandlesNullTimekeeperSingleton | |||
) |
Definition at line 82 of file TimekeeperTest.cpp.
References EXPECT_THROW, folly::Singleton< T, Tag, VaultTag >::make_mock(), one_ms(), SCOPE_EXIT, and folly::futures::sleep().
TEST | ( | Timekeeper | , |
futureWithinHandlesNullTimekeeperSingleton | |||
) |
Definition at line 90 of file TimekeeperTest.cpp.
References EXPECT_THROW, f, folly::Promise< T >::getFuture(), folly::Singleton< T, Tag, VaultTag >::make_mock(), folly::gen::move, one_ms(), and SCOPE_EXIT.
TEST | ( | Timekeeper | , |
semiFutureWithinHandlesNullTimekeeperSingleton | |||
) |
Definition at line 100 of file TimekeeperTest.cpp.
References EXPECT_THROW, f, folly::Promise< T >::getSemiFuture(), folly::Singleton< T, Tag, VaultTag >::make_mock(), folly::gen::move, one_ms(), and SCOPE_EXIT.
TEST | ( | Timekeeper | , |
futureDelayed | |||
) |
Definition at line 110 of file TimekeeperTest.cpp.
References EXPECT_GE, folly::makeFuture(), now(), and one_ms().
TEST | ( | Timekeeper | , |
semiFutureDelayed | |||
) |
Definition at line 120 of file TimekeeperTest.cpp.
References EXPECT_GE, folly::makeSemiFuture(), now(), and one_ms().
TEST | ( | Timekeeper | , |
futureDelayedUnsafe | |||
) |
Definition at line 131 of file TimekeeperTest.cpp.
References EXPECT_GE, folly::makeFuture(), now(), and one_ms().
TEST | ( | Timekeeper | , |
futureDelayedStickyExecutor | |||
) |
Definition at line 141 of file TimekeeperTest.cpp.
References EXPECT_EQ, EXPECT_GE, folly::makeFuture(), folly::makeSemiFuture(), now(), one_ms(), and folly::ManualExecutor::run().
TEST | ( | Timekeeper | , |
futureWithinThrows | |||
) |
Definition at line 200 of file TimekeeperTest.cpp.
References EXPECT_EQ, f, folly::Promise< T >::getFuture(), folly::gen::move, and one_ms().
TEST | ( | Timekeeper | , |
semiFutureWithinThrows | |||
) |
Definition at line 208 of file TimekeeperTest.cpp.
References EXPECT_EQ, f, folly::Promise< T >::getSemiFuture(), folly::gen::move, and one_ms().
TEST | ( | Timekeeper | , |
futureWithinAlreadyComplete | |||
) |
Definition at line 216 of file TimekeeperTest.cpp.
References EXPECT_EQ, f, folly::makeFuture(), folly::gen::move, and one_ms().
TEST | ( | Timekeeper | , |
semiFutureWithinAlreadyComplete | |||
) |
Definition at line 223 of file TimekeeperTest.cpp.
References EXPECT_EQ, f, folly::makeSemiFuture(), folly::gen::move, and one_ms().
TEST | ( | Timekeeper | , |
futureWithinFinishesInTime | |||
) |
Definition at line 230 of file TimekeeperTest.cpp.
References EXPECT_EQ, f, folly::Promise< T >::getFuture(), folly::gen::move, and folly::Promise< T >::setValue().
TEST | ( | Timekeeper | , |
semiFutureWithinFinishesInTime | |||
) |
Definition at line 240 of file TimekeeperTest.cpp.
References EXPECT_EQ, f, folly::Promise< T >::getSemiFuture(), folly::gen::move, and folly::Promise< T >::setValue().
TEST | ( | Timekeeper | , |
futureWithinVoidSpecialization | |||
) |
Definition at line 251 of file TimekeeperTest.cpp.
References folly::makeFuture(), and one_ms().
TEST | ( | Timekeeper | , |
semiFutureWithinVoidSpecialization | |||
) |
Definition at line 255 of file TimekeeperTest.cpp.
References folly::makeSemiFuture(), and one_ms().
TEST | ( | Timekeeper | , |
futureWithinException | |||
) |
Definition at line 259 of file TimekeeperTest.cpp.
References awhile(), EXPECT_THROW, f, folly::Promise< T >::getFuture(), and folly::gen::move.
TEST | ( | Timekeeper | , |
semiFutureWithinException | |||
) |
Definition at line 265 of file TimekeeperTest.cpp.
References awhile(), EXPECT_THROW, f, folly::Promise< T >::getSemiFuture(), and folly::gen::move.
TEST | ( | Timekeeper | , |
onTimeout | |||
) |
Definition at line 271 of file TimekeeperTest.cpp.
References EXPECT_TRUE, flag, folly::makeFuture(), one_ms(), and zero_ms().
TEST | ( | Timekeeper | , |
onTimeoutComplete | |||
) |
Definition at line 285 of file TimekeeperTest.cpp.
References EXPECT_FALSE, flag, folly::makeFuture(), and zero_ms().
TEST | ( | Timekeeper | , |
onTimeoutReturnsFuture | |||
) |
Definition at line 298 of file TimekeeperTest.cpp.
References EXPECT_TRUE, flag, folly::makeFuture(), one_ms(), and zero_ms().
TEST | ( | Timekeeper | , |
onTimeoutVoid | |||
) |
Definition at line 312 of file TimekeeperTest.cpp.
References folly::makeFuture(), one_ms(), and zero_ms().
TEST | ( | Timekeeper | , |
interruptDoesntCrash | |||
) |
Definition at line 320 of file TimekeeperTest.cpp.
References f, folly::futures::sleep(), and too_long().
TEST | ( | Timekeeper | , |
chainedInterruptTest | |||
) |
Definition at line 325 of file TimekeeperTest.cpp.
References EXPECT_FALSE, f, and folly::futures::sleep().
TEST | ( | Timekeeper | , |
futureWithinChainedInterruptTest | |||
) |
Definition at line 334 of file TimekeeperTest.cpp.
References EXPECT_FALSE, EXPECT_TRUE, f, folly::Promise< T >::getFuture(), folly::exception_wrapper::handle(), folly::Promise< T >::setException(), and folly::Promise< T >::setInterruptHandler().
TEST | ( | Timekeeper | , |
semiFutureWithinChainedInterruptTest | |||
) |
Definition at line 349 of file TimekeeperTest.cpp.
References EXPECT_FALSE, EXPECT_TRUE, f, folly::Promise< T >::getSemiFuture(), folly::exception_wrapper::handle(), folly::Promise< T >::setException(), and folly::Promise< T >::setInterruptHandler().
TEST | ( | Timekeeper | , |
executor | |||
) |
Definition at line 364 of file TimekeeperTest.cpp.
References add, count, EXPECT_EQ, f, folly::Promise< T >::getFuture(), one_ms(), and folly::Promise< T >::setValue().
TEST_F | ( | TimekeeperFixture | , |
after | |||
) |
Definition at line 41 of file TimekeeperTest.cpp.
References awhile(), EXPECT_FALSE, EXPECT_GE, f, folly::gen::move, and now().
TEST_F | ( | TimekeeperFixture | , |
atBeforeNow | |||
) |
Definition at line 395 of file TimekeeperTest.cpp.
References EXPECT_FALSE, EXPECT_TRUE, f, now(), and too_long().
TEST_F | ( | TimekeeperFixture | , |
howToCastDuration | |||
) |
TEST_F | ( | TimekeeperFixture | , |
destruction | |||
) |
Definition at line 408 of file TimekeeperTest.cpp.
References folly::ThreadWheelTimekeeper::after(), folly::Optional< Value >::clear(), folly::Optional< Value >::emplace(), EXPECT_FALSE, EXPECT_TRUE, and f.
std::chrono::milliseconds const zero_ms | ( | 0 | ) |
Referenced by TEST().