We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b44dfc9 commit f6aeb0dCopy full SHA for f6aeb0d
instrumentation/google.golang.org/grpc/otelgrpc/test/grpc_test.go
@@ -19,6 +19,7 @@ import (
19
"net"
20
"strconv"
21
"testing"
22
+ "time"
23
24
"github.com/stretchr/testify/assert"
25
"github.com/stretchr/testify/require"
@@ -136,6 +137,12 @@ func TestInterceptors(t *testing.T) {
136
137
})
138
139
t.Run("StreamClientSpans", func(t *testing.T) {
140
+ // StreamClientInterceptor ends the spans asynchronously.
141
+ // We need to wait for all spans before asserting them.
142
+ require.EventuallyWithT(t, func(c *assert.CollectT) {
143
+ assert.Len(c, clientStreamSR.Ended(), 3)
144
+ }, 5*time.Second, 100*time.Millisecond)
145
+
146
checkStreamClientSpans(t, clientStreamSR.Ended(), listener.Addr().String())
147
148
0 commit comments