From dc3979b05c81396a6d33f4bbb7759d41f0950f70 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Fri, 27 Jan 2017 16:45:00 -0800 Subject: [PATCH] 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 --- folly/experimental/test/RefCountTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/folly/experimental/test/RefCountTest.cpp b/folly/experimental/test/RefCountTest.cpp index 7a6fc810..13907ca3 100644 --- a/folly/experimental/test/RefCountTest.cpp +++ b/folly/experimental/test/RefCountTest.cpp @@ -83,10 +83,8 @@ void basicTest() { } template -void stressTest() { - constexpr size_t kItersCount = 10000; - - for (size_t i = 0; i < kItersCount; ++i) { +void stressTest(size_t itersCount) { + for (size_t i = 0; i < itersCount; ++i) { RefCount count; std::mutex mutex; int a{1}; @@ -125,10 +123,12 @@ TEST(TLRefCount, Basic) { } TEST(RCURefCount, Stress) { - stressTest(); + stressTest(100000); } TEST(TLRefCount, Stress) { - stressTest(); + // This is absurdly slow, so we can't + // do it that many times. + stressTest(500); } } -- 2.34.1