Skip to content

Commit

Permalink
simplified to background context
Browse files Browse the repository at this point in the history
  • Loading branch information
prasad-shirodkar committed Apr 20, 2024
1 parent a93250e commit 1909f88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions exporters/stdout/stdoutmetric/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ func testEncoderOption() stdoutmetric.Option {
func testCtxErrHonored(factory func(*testing.T) func(context.Context) error) func(t *testing.T) {
return func(t *testing.T) {
t.Helper()
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
ctx := context.Background()

t.Run("DeadlineExceeded", func(t *testing.T) {
innerCtx, innerCancel := context.WithTimeout(ctx, time.Nanosecond)
Expand Down Expand Up @@ -57,8 +56,7 @@ func testCtxErrHonored(factory func(*testing.T) func(context.Context) error) fun
func testCtxErrIgnored(factory func(*testing.T) func(context.Context) error) func(t *testing.T) {
return func(t *testing.T) {
t.Helper()
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
ctx := context.Background()

t.Run("Canceled Ignored", func(t *testing.T) {
innerCtx, innerCancel := context.WithCancel(ctx)
Expand Down

0 comments on commit 1909f88

Please sign in to comment.