diff options
author | Håvard Pettersen <havardpe@oath.com> | 2022-03-17 13:32:58 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2022-03-17 13:32:58 +0000 |
commit | 3bf5f4849b26c092d51bb2cd5675ecb4ea848998 (patch) | |
tree | f513a7dd4e94703e7f76af42aade90dc2de1d52b | |
parent | 90cdd84b93c368774fa8f30d726c4029ef0638ac (diff) |
reduce large query size when running with tsan
-rw-r--r-- | searchlib/src/tests/query/streaming_query_large_test.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/searchlib/src/tests/query/streaming_query_large_test.cpp b/searchlib/src/tests/query/streaming_query_large_test.cpp index 49875d0c6df..55c844723d9 100644 --- a/searchlib/src/tests/query/streaming_query_large_test.cpp +++ b/searchlib/src/tests/query/streaming_query_large_test.cpp @@ -19,9 +19,17 @@ using namespace search::streaming; #endif #endif +#ifndef __SANITIZE_THREAD__ +#if defined(__has_feature) +#if __has_feature(thread_sanitizer) +#define __SANITIZE_THREAD__ +#endif +#endif +#endif + namespace { -void setMaxStackSize(rlim_t maxStackSize) +[[maybe_unused]] void setMaxStackSize(rlim_t maxStackSize) { struct rlimit limit; getrlimit(RLIMIT_STACK, &limit); @@ -35,12 +43,16 @@ void setMaxStackSize(rlim_t maxStackSize) // NOTE: This test explicitly sets thread stack size and will fail due to // a stack overflow if the stack usage increases. TEST("testveryLongQueryResultingInBug6850778") { - const uint32_t NUMITEMS=20000; + uint32_t NUMITEMS=20000; #ifdef __SANITIZE_ADDRESS__ setMaxStackSize(12_Mi); #else +#ifdef __SANITIZE_THREAD__ + NUMITEMS = 10000; +#else setMaxStackSize(4_Mi); #endif +#endif QueryBuilder<SimpleQueryNodeTypes> builder; for (uint32_t i=0; i <= NUMITEMS; i++) { builder.addAnd(2); |