Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/integration/clientv3/naming/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"strconv"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -92,6 +93,15 @@ func testEtcdGRPCResolver(t *testing.T, lbPolicy string) {
t.Fatalf("unexpected response from foo (e1): %s", resp.GetPayload().GetBody())
}

// For round_robin, gRPC only load-balances across subchannels that are
// READY. Right after dialing, the subchannel to e2 may still be
// connecting, so early calls land entirely on e1 and look identical to
// pick_first, which skews the distribution measured below. Give it a
// moment to finish connecting before starting the measured loop.
if lbPolicy == "round_robin" {
time.Sleep(time.Second)
}

// Send more requests
lastResponse := []byte{'1'}
totalRequests := 3500
Expand Down