From 92e67415cbe1e09eba994ff8118e1c625cbd3804 Mon Sep 17 00:00:00 2001 From: Martin Gencur Date: Mon, 22 Aug 2022 08:12:42 +0200 Subject: [PATCH] Remove workaround for incorrect tracing shutdown The issue https://github.com/knative/pkg/issues/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. --- test/e2e_new/tracing_test.go | 8 +------- test/e2e_new_channel/tracing_test.go | 9 +-------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/test/e2e_new/tracing_test.go b/test/e2e_new/tracing_test.go index 0b64d94f74..4bcf79c06d 100644 --- a/test/e2e_new/tracing_test.go +++ b/test/e2e_new/tracing_test.go @@ -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())) diff --git a/test/e2e_new_channel/tracing_test.go b/test/e2e_new_channel/tracing_test.go index 9a6fc88c20..9800d53f30 100644 --- a/test/e2e_new_channel/tracing_test.go +++ b/test/e2e_new_channel/tracing_test.go @@ -23,7 +23,6 @@ import ( "context" "fmt" "testing" - "time" cetest "github.com/cloudevents/sdk-go/v2/test" "github.com/openzipkin/zipkin-go/model" @@ -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())) @@ -169,7 +162,7 @@ func channelHasMatchingTraceTree(sourceName, sinkName, channelName, eventID stri }, }, } - eventshub.StoreFromContext(ctx, sinkName).AssertAtLeast(t, 1, + eventshub.StoreFromContext(ctx, sinkName).AssertExact(t, 1, MatchKind(EventReceived), tracing.TraceTreeMatches(sourceName, eventID, expectedTree), )