Skip to content

Commit

Permalink
UTs [bmqp/mqbu/mqbs]: limit cycles number for memory sanitizer (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-e1off authored Jun 28, 2024
1 parent e35cf6e commit 779ad5c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/groups/bmq/bmqp/bmqp_messageguidgenerator.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ static void test3_multithreadUseIP()
// This test case times out on AIX if 'k_NUM_GUIDS' is close to 1 million
// (it's unable to complete in 90 seconds).
const int k_NUM_GUIDS = 500000; // 500k
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const int k_NUM_GUIDS = __has_feature(memory_sanitizer) ? 500000 // 500k
: 1000000; // 1M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const int k_NUM_GUIDS = 500000; // 500k
#else
const int k_NUM_GUIDS = 1000000; // 1M
#endif
Expand Down Expand Up @@ -376,6 +383,13 @@ static void test4_multithreadUseHostname()
// This test case times out on AIX if 'k_NUM_GUIDS' is close to 1 million
// (it's unable to complete in 90 seconds).
const int k_NUM_GUIDS = 500000; // 500k
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const int k_NUM_GUIDS = __has_feature(memory_sanitizer) ? 500000 // 500k
: 1000000; // 1M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const int k_NUM_GUIDS = 500000; // 500k
#else
const int k_NUM_GUIDS = 1000000; // 1M
#endif
Expand Down Expand Up @@ -550,6 +564,14 @@ static void test6_defaultHashUniqueness()

#ifdef BSLS_PLATFORM_OS_AIX
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const bsls::Types::Int64 k_NUM_GUIDS = __has_feature(memory_sanitizer)
? 1000000 // 1M
: 10000000; // 10M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#else
const bsls::Types::Int64 k_NUM_GUIDS = 10000000; // 10M
#endif
Expand Down Expand Up @@ -632,6 +654,14 @@ static void test7_customHashUniqueness()

#ifdef BSLS_PLATFORM_OS_AIX
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const bsls::Types::Int64 k_NUM_GUIDS = __has_feature(memory_sanitizer)
? 1000000 // 1M
: 10000000; // 10M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#else
const bsls::Types::Int64 k_NUM_GUIDS = 10000000; // 10M
#endif
Expand Down
16 changes: 16 additions & 0 deletions src/groups/mqb/mqbs/mqbs_datastore.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ static void test2_defaultHashUniqueness()

#ifdef BSLS_PLATFORM_OS_AIX
const bsls::Types::Int64 k_NUM_KEYS = 1000000; // 1M
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const bsls::Types::Int64 k_NUM_GUIDS = __has_feature(memory_sanitizer)
? 1000000 // 1M
: 10000000; // 10M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#else
const bsls::Types::Int64 k_NUM_KEYS = 10000000; // 10M
#endif
Expand Down Expand Up @@ -213,6 +221,14 @@ static void test3_customHashUniqueness()

#ifdef BSLS_PLATFORM_OS_AIX
const bsls::Types::Int64 k_NUM_KEYS = 5000000; // 5M
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const bsls::Types::Int64 k_NUM_GUIDS = __has_feature(memory_sanitizer)
? 5000000 // 5M
: 10000000; // 10M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const bsls::Types::Int64 k_NUM_GUIDS = 5000000; // 5M
#else
const bsls::Types::Int64 k_NUM_KEYS = 10000000; // 10M
#endif
Expand Down
23 changes: 23 additions & 0 deletions src/groups/mqb/mqbu/mqbu_messageguidutil.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ static void test2_multithread()
// This test case times out on AIX if 'k_NUM_GUIDS' is close to 1 million
// (it's unable to complete in 90 seconds).
const int k_NUM_GUIDS = 500000; // 500k
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const int k_NUM_GUIDS = __has_feature(memory_sanitizer) ? 500000 // 500k
: 1000000; // 1M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const int k_NUM_GUIDS = 500000; // 500k
#else
const int k_NUM_GUIDS = 1000000; // 1M
#endif
Expand Down Expand Up @@ -313,6 +320,14 @@ static void test4_defaultHashUniqueness()

#ifdef BSLS_PLATFORM_OS_AIX
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const bsls::Types::Int64 k_NUM_GUIDS = __has_feature(memory_sanitizer)
? 1000000 // 1M
: 10000000; // 10M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#else
const bsls::Types::Int64 k_NUM_GUIDS = 10000000; // 10M
#endif
Expand Down Expand Up @@ -393,6 +408,14 @@ static void test5_customHashUniqueness()

#ifdef BSLS_PLATFORM_OS_AIX
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#elif defined(__has_feature)
// Avoid timeout under MemorySanitizer
const bsls::Types::Int64 k_NUM_GUIDS = __has_feature(memory_sanitizer)
? 1000000 // 1M
: 10000000; // 10M
#elif defined(__SANITIZE_MEMORY__)
// GCC-supported macros for checking MSAN
const bsls::Types::Int64 k_NUM_GUIDS = 1000000; // 1M
#else
const bsls::Types::Int64 k_NUM_GUIDS = 10000000; // 10M
#endif
Expand Down

0 comments on commit 779ad5c

Please sign in to comment.