[clang-tools-extra] r349769 - [clangd] Try to workaround test failure by increasing the timeouts

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 20 08:27:19 PST 2018


Author: ibiryukov
Date: Thu Dec 20 08:27:19 2018
New Revision: 349769

URL: http://llvm.org/viewvc/llvm-project?rev=349769&view=rev
Log:
[clangd] Try to workaround test failure by increasing the timeouts

Ideally we'd figure out a way to run this test without any sleeps, this
workaround is only there to avoid annoying people with test failures
around the holiday period when everyone is on vacation.

Modified:
    clang-tools-extra/trunk/unittests/clangd/BackgroundIndexTests.cpp

Modified: clang-tools-extra/trunk/unittests/clangd/BackgroundIndexTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/BackgroundIndexTests.cpp?rev=349769&r1=349768&r2=349769&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/BackgroundIndexTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/BackgroundIndexTests.cpp Thu Dec 20 08:27:19 2018
@@ -251,7 +251,7 @@ TEST_F(BackgroundIndexTest, PeriodicalIn
   OverlayCDB CDB(/*Base=*/nullptr);
   BackgroundIndex Idx(
       Context::empty(), "", FS, CDB, [&](llvm::StringRef) { return &MSS; },
-      /*BuildIndexPeriodMs=*/100);
+      /*BuildIndexPeriodMs=*/500);
 
   FS.Files[testPath("root/A.cc")] = "#include \"A.h\"";
 
@@ -263,7 +263,7 @@ TEST_F(BackgroundIndexTest, PeriodicalIn
 
   ASSERT_TRUE(Idx.blockUntilIdleForTest());
   EXPECT_THAT(runFuzzyFind(Idx, ""), ElementsAre());
-  std::this_thread::sleep_for(std::chrono::milliseconds(150));
+  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
   EXPECT_THAT(runFuzzyFind(Idx, ""), ElementsAre(Named("X")));
 
   FS.Files[testPath("root/A.h")] = "class Y {};";
@@ -273,7 +273,7 @@ TEST_F(BackgroundIndexTest, PeriodicalIn
 
   ASSERT_TRUE(Idx.blockUntilIdleForTest());
   EXPECT_THAT(runFuzzyFind(Idx, ""), ElementsAre(Named("X")));
-  std::this_thread::sleep_for(std::chrono::milliseconds(150));
+  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
   EXPECT_THAT(runFuzzyFind(Idx, ""), ElementsAre(Named("Y")));
 }
 




More information about the cfe-commits mailing list