Skip to content

Commit 71dcc6b

Browse files
authored
Fix aspnetcore metric test stability (#2236)
1 parent 159ee9d commit 71dcc6b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/OpenTelemetry.Instrumentation.AspNetCore.Tests/MetricTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ void ProcessExport(Batch<MetricItem> batch)
7676
response.EnsureSuccessStatusCode();
7777
}
7878

79+
// We need to let End callback execute as it is executed AFTER response was returned.
80+
// In unit tests environment there may be a lot of parallel unit tests executed, so
81+
// giving some breezing room for the End callback to complete
82+
await Task.Delay(TimeSpan.FromSeconds(1));
83+
7984
// Invokes the TestExporter which will invoke ProcessExport
8085
processor.PullRequest();
8186

0 commit comments

Comments
 (0)