[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.

llvm-svn: 340523
This commit is contained in:
Ilya Biryukov 2018-08-23 10:25:07 +00:00
parent 6cdd12a3ba
commit 1326145fdd
1 changed files with 9 additions and 9 deletions

View File

@ -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, NoopOnEmptyChanges) {
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