Skip to content

Commit

Permalink
Increase the timeout for shutting down the exporter
Browse files Browse the repository at this point in the history
One millisecond is quite short, and I was getting failures locally:

go test ./... + race in ./exporters/otlp
2020/12/14 18:27:54 rpc error: code = Canceled desc = context canceled
2020/12/14 18:27:54 context deadline exceeded
--- FAIL: TestNewExporter_withMultipleAttributeTypes (0.37s)
    otlp_integration_test.go:541: resource span count: got 0, want 1
FAIL
FAIL	go.opentelemetry.io/otel/exporters/otlp	5.278s

or

go test ./... + coverage in ./exporters/otlp
2020/12/14 17:41:16 rpc error: code = Canceled desc = context canceled
2020/12/14 17:41:16 exporter disconnected
--- FAIL: TestNewExporter_endToEnd (1.53s)
    --- FAIL: TestNewExporter_endToEnd/WithCompressor (0.41s)
        otlp_integration_test.go:246: span counts: got 3, want 4
2020/12/14 17:41:18 context canceled
FAIL
coverage: 35.3% of statements in ./...
FAIL	go.opentelemetry.io/otel/exporters/otlp	4.753s
  • Loading branch information
krnowak committed Dec 14, 2020
1 parent eae59a4 commit 081eca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exporters/otlp/otlp_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func newExporterEndToEndTest(t *testing.T, additionalOpts []otlp.GRPCConnectionO
<-time.After(40 * time.Millisecond)

// Now shutdown the exporter
ctx, cancel := context.WithTimeout(ctx, time.Millisecond)
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
if err := exp.Shutdown(ctx); err != nil {
t.Fatalf("failed to stop the exporter: %v", err)
Expand Down Expand Up @@ -525,7 +525,7 @@ func TestNewExporter_withMultipleAttributeTypes(t *testing.T) {
<-time.After(40 * time.Millisecond)

// Now shutdown the exporter
ctx, cancel := context.WithTimeout(ctx, time.Millisecond)
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
if err := exp.Shutdown(ctx); err != nil {
t.Fatalf("failed to stop the exporter: %v", err)
Expand Down

0 comments on commit 081eca3

Please sign in to comment.