From a034262ce21d098b1926a8b480f335ad1065f1a0 Mon Sep 17 00:00:00 2001 From: David Goffredo Date: Tue, 26 Oct 2021 18:03:00 +0000 Subject: [PATCH] test/sample_test.cpp: address review comment --- test/sample_test.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/test/sample_test.cpp b/test/sample_test.cpp index 9b91e19b..a2911cce 100644 --- a/test/sample_test.cpp +++ b/test/sample_test.cpp @@ -228,22 +228,14 @@ TEST_CASE("rules sampler") { ])"; const auto tracer = std::make_shared(tracer_options, writer, sampler); + // The first span will be allowed by the limiter (tested in the previou section). auto span = tracer->StartSpanWithOptions("operation name", span_options); span->FinishWithOptions(finish_options); - // The first trace will be allowed by the limiter. - { - REQUIRE(mwriter->traces.size() == 1); - REQUIRE(mwriter->traces[0].size() == 1); - const auto& metrics = mwriter->traces[0][0]->metrics; - REQUIRE(metrics.count("_sampling_priority_v1")); - REQUIRE(metrics.at("_sampling_priority_v1") == - static_cast(SamplingPriority::UserKeep)); - } - span = tracer->StartSpanWithOptions("operation name", span_options); - span->FinishWithOptions(finish_options); // The second trace will be dropped by the limiter, and the priority will // be `UserDrop`. + span = tracer->StartSpanWithOptions("operation name", span_options); + span->FinishWithOptions(finish_options); { REQUIRE(mwriter->traces.size() == 2); REQUIRE(mwriter->traces[1].size() == 1);