[clang-tools-extra] 4782ccd - [test][clangd] Try to deflake with sanitizers

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 22:53:01 PDT 2022


Author: Vitaly Buka
Date: 2022-09-26T22:52:48-07:00
New Revision: 4782ccde2e1b44ea44a8e83cd1e7041fa31c5c18

URL: https://github.com/llvm/llvm-project/commit/4782ccde2e1b44ea44a8e83cd1e7041fa31c5c18
DIFF: https://github.com/llvm/llvm-project/commit/4782ccde2e1b44ea44a8e83cd1e7041fa31c5c18.diff

LOG: [test][clangd] Try to deflake with sanitizers

Test sometimes fail with:
https://lab.llvm.org/buildbot/#/builders/168/builds/9110

Added: 
    

Modified: 
    clang-tools-extra/clangd/ClangdServer.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index 5c4263d0ee6cb..57c2093bd6951 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -1023,6 +1023,12 @@ ClangdServer::blockUntilIdleForTest(llvm::Optional<double> TimeoutSeconds) {
   // Order is important here: we don't want to block on A and then B,
   // if B might schedule work on A.
 
+#if defined(__has_feature) &&                                                  \
+    (__has_feature(address_sanitizer) || __has_feature(hwaddress_sanitizer) || \
+     __has_feature(memory_sanitizer) || __has_feature(thread_sanitizer))
+  (*TimeoutSeconds) *= 10;
+#endif
+
   // Nothing else can schedule work on TUScheduler, because it's not threadsafe
   // and we're blocking the main thread.
   if (!WorkScheduler->blockUntilIdle(timeoutSeconds(TimeoutSeconds)))


        


More information about the cfe-commits mailing list