Skip to content

Commit

Permalink
Remove workaround for incorrect tracing shutdown
Browse files Browse the repository at this point in the history
The issue knative/pkg#2475 has been resolved.
It's not necessary to send multiple events anymore. Each event should be
exported to Zipking because of the new fix for tracer shutdown.
  • Loading branch information
mgencur committed Aug 22, 2022
1 parent 64d7b7b commit 8f0922d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
8 changes: 1 addition & 7 deletions test/e2e_new/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,12 @@ func TracingHeadersUsingOrderedDeliveryWithTraceExported() *feature.Feature {
sourceName,
eventshub.StartSenderToResource(broker.GVR(), brokerName),
eventshub.InputEvent(ev),
// Send at least two events to workaround https://github.com/knative/pkg/issues/2475.
// There's some time needed for exporting the trace to Zipkin. Sending two events with
// some delay gives the exporter time to export the trace for the first event. The sender
// is shutdown immediately after sending the last event so the trace for the last
// event will probably not be exported.
eventshub.SendMultipleEvents(2, 3*time.Second),
))

f.Assert("received event has traceparent header",
OnStore(sinkName).
Match(MatchKind(EventReceived), hasTraceparentHeader).
AtLeast(1),
Exact(1),
)

f.Assert("event trace exported", brokerHasMatchingTraceTree(sourceName, sinkName, brokerName, ev.ID()))
Expand Down
7 changes: 0 additions & 7 deletions test/e2e_new_channel/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"context"
"fmt"
"testing"
"time"

cetest "github.com/cloudevents/sdk-go/v2/test"
"github.com/openzipkin/zipkin-go/model"
Expand Down Expand Up @@ -87,12 +86,6 @@ func eventWithTraceExported() *feature.Feature {
sourceName,
eventshub.StartSenderToResource(channel_impl.GVR(), channelName),
eventshub.InputEvent(ev),
// Send at least two events to workaround https://github.com/knative/pkg/issues/2475.
// There's some time needed for exporting the trace to Zipkin. Sending two events with
// some delay gives the exporter time to export the trace for the first event. The sender
// is shutdown immediately after sending the last event so the trace for the last
// event will probably not be exported.
eventshub.SendMultipleEvents(2, 3*time.Second),
))

f.Assert("event trace exported", channelHasMatchingTraceTree(sourceName, sinkName, channelName, ev.ID()))
Expand Down

0 comments on commit 8f0922d

Please sign in to comment.