From 12ed5a65daf7bf0d006cbff065fe3e36f51d8d4a Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Fri, 26 Aug 2022 13:35:53 -0700 Subject: [PATCH] Test cleanup. --- .../Logs/BatchLogRecordExportProcessorTests.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/OpenTelemetry.Tests/Logs/BatchLogRecordExportProcessorTests.cs b/test/OpenTelemetry.Tests/Logs/BatchLogRecordExportProcessorTests.cs index 7c39f53e512..feb5834ab19 100644 --- a/test/OpenTelemetry.Tests/Logs/BatchLogRecordExportProcessorTests.cs +++ b/test/OpenTelemetry.Tests/Logs/BatchLogRecordExportProcessorTests.cs @@ -32,7 +32,7 @@ public void StateValuesAndScopeBufferingTest() List exportedItems = new(); - using var exporter = new BatchLogRecordExportProcessor( + using var processor = new BatchLogRecordExportProcessor( new InMemoryExporter(exportedItems), scheduledDelayMilliseconds: int.MaxValue); @@ -45,7 +45,7 @@ public void StateValuesAndScopeBufferingTest() logRecord.ScopeProvider = scopeProvider; logRecord.StateValues = state; - exporter.OnEnd(logRecord); + processor.OnEnd(logRecord); state.Dispose(); @@ -72,7 +72,9 @@ public void StateValuesAndScopeBufferingTest() Assert.True(foundScope); - exporter.Shutdown(); + processor.Shutdown(); + + Assert.Single(exportedItems); } [Fact] @@ -84,7 +86,7 @@ public void StateBufferingTest() // StateValues/ParseStateValues behavior. List exportedItems = new(); - using var exporter = new BatchLogRecordExportProcessor( + using var processor = new BatchLogRecordExportProcessor( new InMemoryExporter(exportedItems)); var logRecord = new LogRecord(); @@ -92,8 +94,8 @@ public void StateBufferingTest() var state = new LogRecordTest.DisposingState("Hello world"); logRecord.State = state; - exporter.OnEnd(logRecord); - exporter.Shutdown(); + processor.OnEnd(logRecord); + processor.Shutdown(); state.Dispose();