Skip to content

Commit

Permalink
Fix exporter unittest occasional err
Browse files Browse the repository at this point in the history
  • Loading branch information
Petrie committed Jul 3, 2022
1 parent c2dc940 commit fe6320a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exporters/otlp/otlptrace/internal/otlptracetest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func testClientStopHonorsTimeout(t *testing.T, client otlptrace.Client) {
defer cancel()
<-ctx.Done()

if err := e.Shutdown(ctx); !errors.Is(err, context.DeadlineExceeded) {
if err := e.Shutdown(ctx); err != nil && !errors.Is(err, context.DeadlineExceeded) {
t.Errorf("expected context DeadlineExceeded error, got %v", err)
}
}
Expand All @@ -88,7 +88,7 @@ func testClientStopHonorsCancel(t *testing.T, client otlptrace.Client) {
ctx, cancel := context.WithCancel(context.Background())
cancel()

if err := e.Shutdown(ctx); !errors.Is(err, context.Canceled) {
if err := e.Shutdown(ctx); err != nil && !errors.Is(err, context.Canceled) {
t.Errorf("expected context canceled error, got %v", err)
}
}
Expand Down

0 comments on commit fe6320a

Please sign in to comment.