Author: Sam McCall Date: 2022-07-07T18:09:54+02:00 New Revision: eb64dbd6e0e617298579d32372fb92e595816d45
URL: https://github.com/llvm/llvm-project/commit/eb64dbd6e0e617298579d32372fb92e595816d45 DIFF: https://github.com/llvm/llvm-project/commit/eb64dbd6e0e617298579d32372fb92e595816d45.diff LOG: [clangd] Fix flaky throttler test The production code doesn't depend on the relative destruction order of the throttle request and the main request, but the test does. Added: Modified: clang-tools-extra/clangd/TUScheduler.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp index a112b666e9ab..4c6c8c679be3 100644 --- a/clang-tools-extra/clangd/TUScheduler.cpp +++ b/clang-tools-extra/clangd/TUScheduler.cpp @@ -498,6 +498,8 @@ class PreambleThread { // Build the preamble and let the waiters know about it. build(std::move(*CurrentReq)); } + // Releasing the throttle before destroying the request assists testing. + Throttle.reset(); bool IsEmpty = false; { std::lock_guard<std::mutex> Lock(Mutex); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits