1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-23 00:07:52 +02:00

SDK: Add Shutdown test for Span Processor (#169)

* SDK: Add Shutdown test for Span Processor

* SDK: Shutdown test for Span Processor. Review fixes
This commit is contained in:
Artem Kartasov
2019-10-09 00:34:19 +07:00
committed by rghetia
parent ef5d2cbb06
commit 93c667978d
3 changed files with 67 additions and 3 deletions

View File

@ -201,4 +201,20 @@ func getSpanContext() core.SpanContext {
SpanID: sid,
TraceFlags: 0x1,
}
}
}
func TestBatchSpanProcessorShutdown(t *testing.T) {
bsp, err := sdktrace.NewBatchSpanProcessor(&testBatchExporter{})
if err != nil {
t.Errorf("Unexpected error while creating processor\n")
}
if bsp == nil {
t.Fatalf("Error creating new instance of BatchSpanProcessor\n")
}
bsp.Shutdown()
// Multiple call to Shutdown() should not panic.
bsp.Shutdown()
}