Skip to content

Commit

Permalink
[clangd] Fix name hiding in TestTracer and disable racy test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kadircet committed May 3, 2020
1 parent e64f99c commit 6c24b59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
Expand Up @@ -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
4 changes: 2 additions & 2 deletions clang-tools-extra/clangd/unittests/support/TestTracer.h
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 6c24b59

Please sign in to comment.