[clang-tools-extra] r340523 - [clangd] Increase the timeouts in TUScheduler tests to 10 seconds.

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 23 03:25:07 PDT 2018


Author: ibiryukov
Date: Thu Aug 23 03:25:07 2018
New Revision: 340523

URL: http://llvm.org/viewvc/llvm-project?rev=340523&view=rev
Log:
[clangd] Increase the timeouts in TUScheduler tests to 10 seconds.

Some of them timeout on our buildbots in certain configurations.
The timeouts are there to avoid hanging indefinitely on deadlocks, so
the exact number we put there does not matter.

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

Modified: clang-tools-extra/trunk/unittests/clangd/TUSchedulerTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/TUSchedulerTests.cpp?rev=340523&r1=340522&r2=340523&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/TUSchedulerTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/TUSchedulerTests.cpp Thu Aug 23 03:25:07 2018
@@ -278,7 +278,7 @@ TEST_F(TUSchedulerTests, EvictedAST) {
   // one that the cache will evict.
   S.update(Foo, getInputs(Foo, SourceContents), WantDiagnostics::Yes,
            [&BuiltASTCounter](std::vector<Diag> Diags) { ++BuiltASTCounter; });
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
   ASSERT_EQ(BuiltASTCounter.load(), 1);
 
   // Build two more files. Since we can retain only 2 ASTs, these should be the
@@ -287,7 +287,7 @@ TEST_F(TUSchedulerTests, EvictedAST) {
            [&BuiltASTCounter](std::vector<Diag> Diags) { ++BuiltASTCounter; });
   S.update(Baz, getInputs(Baz, SourceContents), WantDiagnostics::Yes,
            [&BuiltASTCounter](std::vector<Diag> Diags) { ++BuiltASTCounter; });
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
   ASSERT_EQ(BuiltASTCounter.load(), 3);
 
   // Check only the last two ASTs are retained.
@@ -296,7 +296,7 @@ TEST_F(TUSchedulerTests, EvictedAST) {
   // Access the old file again.
   S.update(Foo, getInputs(Foo, OtherSourceContents), WantDiagnostics::Yes,
            [&BuiltASTCounter](std::vector<Diag> Diags) { ++BuiltASTCounter; });
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
   ASSERT_EQ(BuiltASTCounter.load(), 4);
 
   // Check the AST for foo.cpp is retained now and one of the others got
@@ -333,13 +333,13 @@ TEST_F(TUSchedulerTests, EmptyPreamble)
                                 0u);
                     });
   // Wait for the preamble is being built.
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
 
   // Update the file which results in an empty preamble.
   S.update(Foo, getInputs(Foo, WithEmptyPreamble), WantDiagnostics::Auto,
            [](std::vector<Diag>) {});
   // Wait for the preamble is being built.
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
   S.runWithPreamble("getEmptyPreamble", Foo,
                     [&](llvm::Expected<InputsAndPreamble> Preamble) {
                       // We expect to get an empty preamble.
@@ -409,7 +409,7 @@ TEST_F(TUSchedulerTests, NoopOnEmptyChan
     Updated = false;
     S.update(Source, std::move(Inputs), WantDiagnostics::Yes,
              [&Updated](std::vector<Diag>) { Updated = true; });
-    bool UpdateFinished = S.blockUntilIdle(timeoutSeconds(1));
+    bool UpdateFinished = S.blockUntilIdle(timeoutSeconds(10));
     if (!UpdateFinished)
       ADD_FAILURE() << "Updated has not finished in one second. Threading bug?";
     return Updated;
@@ -454,14 +454,14 @@ TEST_F(TUSchedulerTests, NoChangeDiags)
     // Make sure the AST was actually built.
     cantFail(std::move(IA));
   });
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
 
   // Even though the inputs didn't change and AST can be reused, we need to
   // report the diagnostics, as they were not reported previously.
   std::atomic<bool> SeenDiags(false);
   S.update(FooCpp, getInputs(FooCpp, Contents), WantDiagnostics::Auto,
            [&](std::vector<Diag>) { SeenDiags = true; });
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
   ASSERT_TRUE(SeenDiags);
 
   // Subsequent request does not get any diagnostics callback because the same
@@ -469,7 +469,7 @@ TEST_F(TUSchedulerTests, NoChangeDiags)
   S.update(
       FooCpp, getInputs(FooCpp, Contents), WantDiagnostics::Auto,
       [&](std::vector<Diag>) { ADD_FAILURE() << "Should not be called."; });
-  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(1)));
+  ASSERT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
 }
 
 } // namespace




More information about the cfe-commits mailing list