File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
instrumentation/google.golang.org/grpc/otelgrpc/test Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
19
19
"net"
20
20
"strconv"
21
21
"testing"
22
+ "time"
22
23
23
24
"github.com/stretchr/testify/assert"
24
25
"github.com/stretchr/testify/require"
@@ -136,6 +137,12 @@ func TestInterceptors(t *testing.T) {
136
137
})
137
138
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
+
139
146
checkStreamClientSpans (t , clientStreamSR .Ended (), listener .Addr ().String ())
140
147
})
141
148
You can’t perform that action at this time.
0 commit comments