Commit dc3979b0 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Actually do the stress test on RCURefCount and make the TLRefCountTest not take 2 minutes

Summary: Adjusting the iteration count significantly reduces the runtime of the `TLRefCount.Stress` test to ~5 seconds. Working with that same timeframe, we can get away with increasing the iteration count of the (now tested) `RCURefCount.Stress` test to 100k, up from it's previous 10k.

Reviewed By: markisaa

Differential Revision: D4477750

fbshipit-source-id: 6a89dbb65f460655db0cb33926cc331dc1904f1c
parent 581791b3
...@@ -83,10 +83,8 @@ void basicTest() { ...@@ -83,10 +83,8 @@ void basicTest() {
} }
template <typename RefCount> template <typename RefCount>
void stressTest() { void stressTest(size_t itersCount) {
constexpr size_t kItersCount = 10000; for (size_t i = 0; i < itersCount; ++i) {
for (size_t i = 0; i < kItersCount; ++i) {
RefCount count; RefCount count;
std::mutex mutex; std::mutex mutex;
int a{1}; int a{1};
...@@ -125,10 +123,12 @@ TEST(TLRefCount, Basic) { ...@@ -125,10 +123,12 @@ TEST(TLRefCount, Basic) {
} }
TEST(RCURefCount, Stress) { TEST(RCURefCount, Stress) {
stressTest<TLRefCount>(); stressTest<RCURefCount>(100000);
} }
TEST(TLRefCount, Stress) { TEST(TLRefCount, Stress) {
stressTest<TLRefCount>(); // This is absurdly slow, so we can't
// do it that many times.
stressTest<TLRefCount>(500);
} }
} }
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