reduce the number of iteration when test SharedMutexTest in ASAN mode
authorTianjiao Yin <ytj@fb.com>
Sat, 18 Nov 2017 14:39:09 +0000 (06:39 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 18 Nov 2017 14:50:50 +0000 (06:50 -0800)
Summary: This unit-test takes too long to finish in ASAN mode from heavily loaded system (more than 10 minutes).

Reviewed By: yfeldblum

Differential Revision: D6362111

fbshipit-source-id: b097eff60f88ace4fb869132598806700804e267

folly/test/SharedMutexTest.cpp

index 9e04edc76a0603c37c0475699c0cc4d890d2b287..f27ba1bcf21076c5609d844d1f5d7e5ef9ed345d 100644 (file)
@@ -1052,14 +1052,14 @@ TEST(SharedMutex, deterministic_lost_wakeup_write_prio) {
 }
 
 TEST(SharedMutex, mixed_mostly_write_read_prio) {
-  for (int pass = 0; pass < 5; ++pass) {
+  for (int pass = 0; pass < (folly::kIsSanitizeAddress ? 1 : 5); ++pass) {
     runMixed<atomic, SharedMutexReadPriority, TokenLocker>(
         50000, 300, 0.9, false);
   }
 }
 
 TEST(SharedMutex, mixed_mostly_write_write_prio) {
-  for (int pass = 0; pass < 5; ++pass) {
+  for (int pass = 0; pass < (folly::kIsSanitizeAddress ? 1 : 5); ++pass) {
     runMixed<atomic, SharedMutexWritePriority, TokenLocker>(
         50000, 300, 0.9, false);
   }
@@ -1229,7 +1229,7 @@ TEST(SharedMutex, remote_write_prio) {
 }
 
 TEST(SharedMutex, remote_read_prio) {
-  for (int pass = 0; pass < 100; ++pass) {
+  for (int pass = 0; pass < (folly::kIsSanitizeAddress ? 1 : 100); ++pass) {
     runRemoteUnlock<SharedMutexReadPriority, atomic>(100000, 0.1, 0.1, 5, 5);
   }
 }