diff --git a/src/groups/mwc/mwcio/mwcio_ntcchannelfactory.t.cpp b/src/groups/mwc/mwcio/mwcio_ntcchannelfactory.t.cpp index 979cc466f..69e28b282 100644 --- a/src/groups/mwc/mwcio/mwcio_ntcchannelfactory.t.cpp +++ b/src/groups/mwc/mwcio/mwcio_ntcchannelfactory.t.cpp @@ -98,6 +98,21 @@ static const ChannelWatermarkType::Enum WAT_HIGH = static const ChannelWatermarkType::Enum WAT_LOW = ChannelWatermarkType::e_LOW_WATERMARK; +#ifdef BSLS_PLATFORM_OS_SOLARIS +static const bool skipTest = true; +#elif defined( \ + __has_feature) // Clang-supported method for checking sanitizers. +static const bool skipTest = __has_feature(memory_sanitizer) || + __has_feature(thread_sanitizer) || + __has_feature(undefined_behavior_sanitizer); +#elif defined(__SANITIZE_MEMORY__) || defined(__SANITIZE_THREAD__) || \ + defined(__SANITIZE_UNDEFINED__) +// GCC-supported macros for checking MSAN, TSAN and UBSAN. +static const bool skipTest = true; +#else +static const bool skipTest = false; // Default to running the test. +#endif + // ======================== // class Tester_ChannelInfo // ======================== @@ -1040,6 +1055,22 @@ static void test6_preCreationCbTest() { mwctst::TestHelper::printTestName("Pre Creation Cb Test"); + if (skipTest) { + // This test has been disabled for Solaris/MSan/TSan/UBSan build. This + // test relies on the timings of certain callbacks being fired before + // or after certain operations. Normally this timing is always + // observed, but in msan/tsan/ubsan enabled build, the timing gets + // changed, leading to test failure. Of course, the right fix is to + // not rely on these timings, which can be worked on if the test starts + // failing in non-instrumented builds. Additionally, we could try to + // enable this test in MSan/TSan/UBSan build once all MSan/TSan/UBSan + // reports have been fixed to see if that helps (see `msansup.txt`, + // `tsansup.txt` and `ubsansup.txt`). + bsl::cout << "Test skipped (running on Solaris or under sanitizer)" + << bsl::endl; + return; // RETURN + } + Tester t(s_allocator_p); // Concern 'a' @@ -1075,6 +1106,22 @@ static void test5_visitChannelsTest() { mwctst::TestHelper::printTestName("Cancel Handle Test"); + if (skipTest) { + // This test has been disabled for Solaris/MSan/TSan/UBSan build. This + // test relies on the timings of certain callbacks being fired before + // or after certain operations. Normally this timing is always + // observed, but in msan/tsan/ubsan enabled build, the timing gets + // changed, leading to test failure. Of course, the right fix is to + // not rely on these timings, which can be worked on if the test starts + // failing in non-instrumented builds. Additionally, we could try to + // enable this test in MSan/TSan/UBSan build once all MSan/TSan/UBSan + // reports have been fixed to see if that helps (see `msansup.txt`, + // `tsansup.txt` and `ubsansup.txt`). + bsl::cout << "Test skipped (running on Solaris or under sanitizer)" + << bsl::endl; + return; // RETURN + } + Tester t(s_allocator_p); // Concerns 'a' @@ -1115,31 +1162,19 @@ static void test4_cancelHandleTest() { mwctst::TestHelper::printTestName("Cancel Handle Test"); -#if defined(__has_feature) // Clang-supported method for checking sanitizers. - const bool skipTestForSanitizers = __has_feature(memory_sanitizer) || - __has_feature(thread_sanitizer) || - __has_feature( - undefined_behavior_sanitizer); -#elif defined(__SANITIZE_MEMORY__) || defined(__SANITIZE_THREAD__) || \ - defined(__SANITIZE_UNDEFINED__) - // GCC-supported macros for checking MSAN and TSAN. - const bool skipTestForSanitizers = true; -#else - const bool skipTestForSanitizers = false; // Default to running the test. -#endif - - if (skipTestForSanitizers) { - // This test has been disabled for MSan/TSan/UBSan build. This test - // relies on the timings of certain callbacks being fired before or - // after certain operations. Normally this timing is always observed, - // but in msan/tsan/ubsan enabled build, the timing gets changed, - // leading to test failure. Of course, the right fix is to not rely on - // these timings, which can be worked on if the test starts failing in - // non-instrumented builds. Additionally, we could try to enable this - // test in MSan/TSan/UBSan build once all MSan/TSan/UBSan reports have - // been fixed to see if that helps (see `msansup.txt`, `tsansup.txt` - // and `ubsansup.txt`). - bsl::cout << "Test skipped (running under sanitizer)" << bsl::endl; + if (skipTest) { + // This test has been disabled for Solaris/MSan/TSan/UBSan build. This + // test relies on the timings of certain callbacks being fired before + // or after certain operations. Normally this timing is always + // observed, but in msan/tsan/ubsan enabled build, the timing gets + // changed, leading to test failure. Of course, the right fix is to + // not rely on these timings, which can be worked on if the test starts + // failing in non-instrumented builds. Additionally, we could try to + // enable this test in MSan/TSan/UBSan build once all MSan/TSan/UBSan + // reports have been fixed to see if that helps (see `msansup.txt`, + // `tsansup.txt` and `ubsansup.txt`). + bsl::cout << "Test skipped (running on Solaris or under sanitizer)" + << bsl::endl; return; // RETURN } @@ -1197,6 +1232,22 @@ static void test3_watermarkTest() { mwctst::TestHelper::printTestName("Watermark Test"); + if (skipTest) { + // This test has been disabled for Solaris/MSan/TSan/UBSan build. This + // test relies on the timings of certain callbacks being fired before + // or after certain operations. Normally this timing is always + // observed, but in msan/tsan/ubsan enabled build, the timing gets + // changed, leading to test failure. Of course, the right fix is to + // not rely on these timings, which can be worked on if the test starts + // failing in non-instrumented builds. Additionally, we could try to + // enable this test in MSan/TSan/UBSan build once all MSan/TSan/UBSan + // reports have been fixed to see if that helps (see `msansup.txt`, + // `tsansup.txt` and `ubsansup.txt`). + bsl::cout << "Test skipped (running on Solaris or under sanitizer)" + << bsl::endl; + return; // RETURN + } + Tester t(s_allocator_p); // Concern 'a' @@ -1286,6 +1337,22 @@ static void test1_breathingTest() { mwctst::TestHelper::printTestName("Breathing Test"); + if (skipTest) { + // This test has been disabled for Solaris/MSan/TSan/UBSan build. This + // test relies on the timings of certain callbacks being fired before + // or after certain operations. Normally this timing is always + // observed, but in msan/tsan/ubsan enabled build, the timing gets + // changed, leading to test failure. Of course, the right fix is to + // not rely on these timings, which can be worked on if the test starts + // failing in non-instrumented builds. Additionally, we could try to + // enable this test in MSan/TSan/UBSan build once all MSan/TSan/UBSan + // reports have been fixed to see if that helps (see `msansup.txt`, + // `tsansup.txt` and `ubsansup.txt`). + bsl::cout << "Test skipped (running on Solaris or under sanitizer)" + << bsl::endl; + return; // RETURN + } + Tester t(s_allocator_p); t.init(L_);