From 62287739ea7326833d9bd8fa86fc9070f1e6f9d9 Mon Sep 17 00:00:00 2001 From: Alan West <3676547+alanwest@users.noreply.github.com> Date: Thu, 9 Jun 2022 13:20:42 -0700 Subject: [PATCH] Show this little test that it has potential --- .../OtlpTraceExporterTests.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs index 2ccb131c88e..3dd760c4190 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs @@ -140,15 +140,15 @@ public void ToOtlpResourceSpansTest(bool includeServiceNameInResource) resourceBuilder.AddService("service-name", "ns1"); } + var exportedItems = new List(); var builder = Sdk.CreateTracerProviderBuilder() .SetResourceBuilder(resourceBuilder) .AddSource(sources[0].Name) - .AddSource(sources[1].Name); + .AddSource(sources[1].Name) + .AddProcessor(new SimpleActivityExportProcessor(new InMemoryExporter(exportedItems))); using var openTelemetrySdk = builder.Build(); - var exportedItems = new List(); - var processor = new BatchActivityExportProcessor(new InMemoryExporter(exportedItems)); const int numOfSpans = 10; bool isEven; for (var i = 0; i < numOfSpans; i++) @@ -161,8 +161,6 @@ public void ToOtlpResourceSpansTest(bool includeServiceNameInResource) using Activity activity = source.StartActivity($"span-{i}", activityKind, parentContext: default, activityTags); } - processor.Shutdown(); - Assert.Equal(10, exportedItems.Count); var batch = new Batch(exportedItems.ToArray(), exportedItems.Count); RunTest(batch);