[clangd] Fix name hiding in TestTracer and disable racy test for now

This commit is contained in:
Kadir Cetinkaya 2020-05-03 11:44:52 +02:00
parent e64f99c51a
commit 6c24b59ca1
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
2 changed files with 2 additions and 11 deletions

View File

@ -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

View File

@ -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 @@ private:
std::mutex Mu;
/// Measurements recorded per metric per label.
llvm::StringMap<llvm::StringMap<std::vector<double>>> Measurements;
Session Session;
Session S;
};
} // namespace trace