Skip to content

Commit

Permalink
fix exporter unittest occasional error
Browse files Browse the repository at this point in the history
  • Loading branch information
Petrie committed Jul 3, 2022
1 parent c2dc940 commit ff2fdbe
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); !errors.Is(err, context.DeadlineExceeded) || err == nil {
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); !errors.Is(err, context.Canceled) || err == nil {
t.Errorf("expected context canceled error, got %v", err)
}
}
Expand Down

0 comments on commit ff2fdbe

Please sign in to comment.