From ec19d5ea79ca5b4222d702030f8fd042604cc08a Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Thu, 28 Oct 2021 14:45:20 +0200 Subject: [PATCH] dcsctp: Don't run network tests with TSAN or MSAN Networks tests were previously disabled if building in debug mode as debug mode adds DCHECKs, and when DCHECKs are enabled, a lot of the components in dcSCTP will add consistency checks, and they can be really expensive to run in these network tests. However, if running in with TSAN or MSAN sanitizers and with DCHECKs enabled, they also take a long time. Current run-time on my relatively fast CPU (with is_debug=false): (no sanitizer) always_dcheck=false: 2.5s (no sanitizer) always_dcheck=true: 31s is_tsan=true, always_dcheck=false: 53s is_tsan=true, always_dcheck=true: 5m50s <-- too slow is_asan=true, always_dcheck=false: 13s is_asan=true, always_dcheck=true: 47s is_msan=true, always_dcheck=false: 35s is_msan=true, always_dcheck=true: 1m53s <-- too slow Note that buildbots may be much slower than my computer. Bug: webrtc:12943 Change-Id: If044ee9936372d54c9899b4864156c9f680af0b6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236581 Reviewed-by: Mirko Bonadei Commit-Queue: Victor Boivie Cr-Commit-Position: refs/heads/main@{#35276} --- net/dcsctp/socket/dcsctp_socket_network_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/dcsctp/socket/dcsctp_socket_network_test.cc b/net/dcsctp/socket/dcsctp_socket_network_test.cc index 94a5f20ef5..bfd748ac0f 100644 --- a/net/dcsctp/socket/dcsctp_socket_network_test.cc +++ b/net/dcsctp/socket/dcsctp_socket_network_test.cc @@ -37,12 +37,14 @@ #include "rtc_base/time_utils.h" #include "test/gmock.h" -#if !defined(WEBRTC_ANDROID) && defined(NDEBUG) +#if !defined(WEBRTC_ANDROID) && defined(NDEBUG) && \ + !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) #define DCSCTP_NDEBUG_TEST(t) t #else -// In debug mode, these tests are too expensive to run due to extensive -// consistency checks that iterate on all outstanding chunks. Same with low-end -// Android devices, which have difficulties with these tests. +// In debug mode, and when MSAN or TSAN sanitizers are enabled, these tests are +// too expensive to run due to extensive consistency checks that iterate on all +// outstanding chunks. Same with low-end Android devices, which have +// difficulties with these tests. #define DCSCTP_NDEBUG_TEST(t) DISABLED_##t #endif