Skip to content

Commit

Permalink
otelgrpc: Stablize TestInterceptors (#4535)
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Nov 8, 2023
1 parent b44dfc9 commit f6aeb0d
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@ import (
"net"
"strconv"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -136,6 +137,12 @@ func TestInterceptors(t *testing.T) {
})

t.Run("StreamClientSpans", func(t *testing.T) {
// StreamClientInterceptor ends the spans asynchronously.
// We need to wait for all spans before asserting them.
require.EventuallyWithT(t, func(c *assert.CollectT) {
assert.Len(c, clientStreamSR.Ended(), 3)
}, 5*time.Second, 100*time.Millisecond)

checkStreamClientSpans(t, clientStreamSR.Ended(), listener.Addr().String())
})

Expand Down

0 comments on commit f6aeb0d

Please sign in to comment.