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 (
1919 "net"
2020 "strconv"
2121 "testing"
22+ "time"
2223
2324 "github.com/stretchr/testify/assert"
2425 "github.com/stretchr/testify/require"
@@ -136,6 +137,12 @@ func TestInterceptors(t *testing.T) {
136137 })
137138
138139 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+
139146 checkStreamClientSpans (t , clientStreamSR .Ended (), listener .Addr ().String ())
140147 })
141148
You can’t perform that action at this time.
0 commit comments