Index: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp =================================================================== --- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp +++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp @@ -355,8 +355,12 @@ 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. - BackgroundQueue::preventThreadStarvationInTests(); + else if (EnableBackgroundIndex) + BackgroundQueue::preventThreadStarvationInTests(); } if (Test || EnableTestScheme) { static URISchemeRegistry::Add X(