Skip to content

Commit

Permalink
Sleep for a second to trigger the timeout
Browse files Browse the repository at this point in the history
Sometimes CI has it's better moments, so it's blazing fast and manages
to finish shutting the exporter down within the 1 microsecond timeout.
  • Loading branch information
krnowak committed Dec 14, 2020
1 parent c944922 commit eae59a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions exporters/otlp/otlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func TestExporterShutdownHonorsTimeout(t *testing.T) {
}

innerCtx, innerCancel := context.WithTimeout(ctx, time.Microsecond)
<-time.After(time.Second)
if err := e.Shutdown(innerCtx); err == nil {
t.Error("expected context DeadlineExceeded error, got nil")
} else if !errors.Is(err, context.DeadlineExceeded) {
Expand Down

0 comments on commit eae59a4

Please sign in to comment.