Skip to content

Commit

Permalink
removed flaky deadline test case
Browse files Browse the repository at this point in the history
  • Loading branch information
prasad-shirodkar committed Apr 17, 2024
1 parent 326e7f6 commit 3dae347
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions exporters/stdout/stdouttrace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestExporterExportSpan(t *testing.T) {
opts []stdouttrace.Option
expectNow time.Time
ctx context.Context
wantError error
wantErr error
}{
{
opts: []stdouttrace.Option{stdouttrace.WithPrettyPrint()},
Expand All @@ -80,16 +80,7 @@ func TestExporterExportSpan(t *testing.T) {
cancel()
return ctx
}(),
wantError: context.Canceled,
},
{
opts: []stdouttrace.Option{},
ctx: func() context.Context {
ctx, cancel := context.WithTimeout(context.Background(), time.Nanosecond)
t.Cleanup(cancel)
return ctx
}(),
wantError: context.DeadlineExceeded,
wantErr: context.Canceled,
},
}

Expand All @@ -100,9 +91,9 @@ func TestExporterExportSpan(t *testing.T) {
require.Nil(t, err)

err = ex.ExportSpans(tt.ctx, tracetest.SpanStubs{ss, ss}.Snapshots())
assert.Equal(t, tt.wantError, err)
assert.Equal(t, tt.wantErr, err)

if tt.wantError == nil {
if tt.wantErr == nil {
got := b.String()
wantone := expectedJSON(tt.expectNow)
assert.Equal(t, wantone+wantone, got)
Expand Down

0 comments on commit 3dae347

Please sign in to comment.