Skip to content

Commit

Permalink
Test cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Aug 26, 2022
1 parent 4b1b10a commit 12ed5a6
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void StateValuesAndScopeBufferingTest()

List<LogRecord> exportedItems = new();

using var exporter = new BatchLogRecordExportProcessor(
using var processor = new BatchLogRecordExportProcessor(
new InMemoryExporter<LogRecord>(exportedItems),
scheduledDelayMilliseconds: int.MaxValue);

Expand All @@ -45,7 +45,7 @@ public void StateValuesAndScopeBufferingTest()
logRecord.ScopeProvider = scopeProvider;
logRecord.StateValues = state;

exporter.OnEnd(logRecord);
processor.OnEnd(logRecord);

state.Dispose();

Expand All @@ -72,7 +72,9 @@ public void StateValuesAndScopeBufferingTest()

Assert.True(foundScope);

exporter.Shutdown();
processor.Shutdown();

Assert.Single(exportedItems);
}

[Fact]
Expand All @@ -84,16 +86,16 @@ public void StateBufferingTest()
// StateValues/ParseStateValues behavior.
List<LogRecord> exportedItems = new();

using var exporter = new BatchLogRecordExportProcessor(
using var processor = new BatchLogRecordExportProcessor(
new InMemoryExporter<LogRecord>(exportedItems));

var logRecord = new LogRecord();

var state = new LogRecordTest.DisposingState("Hello world");
logRecord.State = state;

exporter.OnEnd(logRecord);
exporter.Shutdown();
processor.OnEnd(logRecord);
processor.Shutdown();

state.Dispose();

Expand Down

0 comments on commit 12ed5a6

Please sign in to comment.