Skip to content

Commit

Permalink
fix(tests): flush spans before checking
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
  • Loading branch information
rustatian committed Jul 8, 2024
1 parent b0a5ffd commit 28f0d02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/grpc_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ func TestGrpcOtel(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "TOST", resp.Msg)

stopCh <- struct{}{}
wg.Wait()

time.Sleep(time.Second * 3)

req2, err := http.NewRequestWithContext(context.Background(), http.MethodGet, "http://127.0.0.1:9411/api/v2/spans?serviceName=rr_test_grpc", nil)
Expand All @@ -199,9 +202,6 @@ func TestGrpcOtel(t *testing.T) {
// contains spans
assert.Contains(t, string(bd), "service.echo/ping")
_ = resp2.Body.Close()

stopCh <- struct{}{}
wg.Wait()
}

func TestGrpcCheckStatus(t *testing.T) {
Expand Down

0 comments on commit 28f0d02

Please sign in to comment.