Control the number of threads in TestExecutor
[folly.git] / folly / futures / test / RetryingTest.cpp
index 2de5c8a441a4a6884181eb4699ca60717381b24a..43a15ea2221754cdaec099821e8e061600fb5bab 100644 (file)
@@ -151,7 +151,7 @@ TEST(RetryingTest, large_retries) {
     PCHECK(setrlimit(RLIMIT_AS, &oldMemLimit) == 0);
   };
 
-  TestExecutor executor;
+  TestExecutor executor(4);
   // size of implicit promise is at least the size of the return.
   using LargeReturn = array<uint64_t, 16000>;
   auto func = [&executor](size_t retryNum) -> Future<LargeReturn> {
@@ -172,6 +172,8 @@ TEST(RetryingTest, large_retries) {
         func));
   }
 
+  // 40 * 10,000 * 16,000B > 1GB; we should avoid OOM
+
   for (auto& f : futures) {
     f.wait();
     EXPECT_TRUE(f.hasValue());