[clangd] Disable background-index on lit-tests by default

Summary:
Since background-index can perform disk writes, we don't want to turn
it on tests that won't clear it.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64990

llvm-svn: 366575
This commit is contained in:
Kadir Cetinkaya 2019-07-19 13:40:30 +00:00
parent 5905aae169
commit 9dc0160d26
1 changed files with 5 additions and 1 deletions

View File

@ -355,7 +355,11 @@ int main(int argc, char *argv[]) {
InputStyle = JSONStreamStyle::Delimited;
LogLevel = Logger::Verbose;
PrettyPrint = true;
// Disable background index on lit tests by default to prevent disk writes.
if (!EnableBackgroundIndex.getNumOccurrences())
EnableBackgroundIndex = false;
// Ensure background index makes progress.
else if (EnableBackgroundIndex)
BackgroundQueue::preventThreadStarvationInTests();
}
if (Test || EnableTestScheme) {