mirror of https://github.com/grpc/grpc-go.git
Fixed the test
This commit is contained in:
parent
41a5eb4428
commit
7db3821ece
|
|
@ -1968,7 +1968,7 @@ func (s) TestTraceSpan_WithRetriesAndNameResolutionDelay(t *testing.T) {
|
||||||
if err := tt.doCall(ctx, client); err != nil {
|
if err := tt.doCall(ctx, client); err != nil {
|
||||||
t.Fatalf("%s call failed: %v", tt.name, err)
|
t.Fatalf("%s call failed: %v", tt.name, err)
|
||||||
}
|
}
|
||||||
|
fmt.Println("envconfig.NewPickFirstEnabled ", envconfig.NewPickFirstEnabled)
|
||||||
// The old pick_first LB policy emits a duplicate
|
// The old pick_first LB policy emits a duplicate
|
||||||
// "Delayed LB pick complete" event.
|
// "Delayed LB pick complete" event.
|
||||||
// TODO: Remove the extra event in the test referencing this issue.
|
// TODO: Remove the extra event in the test referencing this issue.
|
||||||
|
|
@ -1976,7 +1976,19 @@ func (s) TestTraceSpan_WithRetriesAndNameResolutionDelay(t *testing.T) {
|
||||||
if !envconfig.NewPickFirstEnabled {
|
if !envconfig.NewPickFirstEnabled {
|
||||||
tt.wantSpanInfosFn = addExtraDelayedLBEvent(tt.wantSpanInfosFn)
|
tt.wantSpanInfosFn = addExtraDelayedLBEvent(tt.wantSpanInfosFn)
|
||||||
}
|
}
|
||||||
|
for _, span := range tt.wantSpanInfosFn {
|
||||||
|
fmt.Printf("Want Span Name: %s\n", span.name)
|
||||||
|
for _, event := range span.events {
|
||||||
|
fmt.Printf("Want Event Name: %s\n", event.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
spans, err := waitForTraceSpans(ctx, exporter, tt.wantSpanInfosFn)
|
spans, err := waitForTraceSpans(ctx, exporter, tt.wantSpanInfosFn)
|
||||||
|
for _, span := range spans {
|
||||||
|
fmt.Printf("Expected Span Name: %s\n", span.Name)
|
||||||
|
for _, event := range span.Events {
|
||||||
|
fmt.Printf(" Expected Event Name: %s\n", event.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
@ -1986,6 +1998,7 @@ func (s) TestTraceSpan_WithRetriesAndNameResolutionDelay(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func addExtraDelayedLBEvent(spans []traceSpanInfo) []traceSpanInfo {
|
func addExtraDelayedLBEvent(spans []traceSpanInfo) []traceSpanInfo {
|
||||||
|
fmt.Println("envconfig.NewPickFirstEnabled addExtraDelayedLBEvent", envconfig.NewPickFirstEnabled)
|
||||||
const eventName = "Delayed LB pick complete"
|
const eventName = "Delayed LB pick complete"
|
||||||
duplicateEvent := trace.Event{Name: eventName}
|
duplicateEvent := trace.Event{Name: eventName}
|
||||||
for i, s := range spans {
|
for i, s := range spans {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue