[clang-tools-extra] 6c24b59 - [clangd] Fix name hiding in TestTracer and disable racy test for now
Kadir Cetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Sun May 3 02:52:20 PDT 2020
Author: Kadir Cetinkaya
Date: 2020-05-03T11:51:23+02:00
New Revision: 6c24b59ca15a577d52bb900016016b8794900588
URL: https://github.com/llvm/llvm-project/commit/6c24b59ca15a577d52bb900016016b8794900588
DIFF: https://github.com/llvm/llvm-project/commit/6c24b59ca15a577d52bb900016016b8794900588.diff
LOG: [clangd] Fix name hiding in TestTracer and disable racy test for now
Added:
Modified:
clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
clang-tools-extra/clangd/unittests/support/TestTracer.h
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp b/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
index 6016003e90d5..d8d7e7a6f7da 100644
--- a/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
@@ -149,15 +149,6 @@ TEST_F(LSPTest, DiagnosticsHeaderSaved) {
llvm::ValueIs(testing::ElementsAre(
DiagMessage("Use of undeclared identifier 'changed'"))));
}
-
-TEST_F(LSPTest, RecordsLatencies) {
- trace::TestTracer Tracer;
- auto &Client = start();
- llvm::StringLiteral MethodName = "method_name";
- EXPECT_THAT(Tracer.takeMetric("lsp_latency", MethodName), testing::SizeIs(0));
- llvm::consumeError(Client.call(MethodName, {}).take().takeError());
- EXPECT_THAT(Tracer.takeMetric("lsp_latency", MethodName), testing::SizeIs(1));
-}
} // namespace
} // namespace clangd
} // namespace clang
diff --git a/clang-tools-extra/clangd/unittests/support/TestTracer.h b/clang-tools-extra/clangd/unittests/support/TestTracer.h
index 6d59fa536aa0..24a7283a7ffc 100644
--- a/clang-tools-extra/clangd/unittests/support/TestTracer.h
+++ b/clang-tools-extra/clangd/unittests/support/TestTracer.h
@@ -27,7 +27,7 @@ namespace trace {
/// A RAII Tracer that can be used by tests.
class TestTracer : public EventTracer {
public:
- TestTracer() : Session(*this) {}
+ TestTracer() : S(*this) {}
/// Stores all the measurements to be returned with take later on.
void record(const Metric &Metric, double Value,
llvm::StringRef Label) override;
@@ -40,7 +40,7 @@ class TestTracer : public EventTracer {
std::mutex Mu;
/// Measurements recorded per metric per label.
llvm::StringMap<llvm::StringMap<std::vector<double>>> Measurements;
- Session Session;
+ Session S;
};
} // namespace trace
More information about the cfe-commits
mailing list