Skip to content

Commit

Permalink
[xds_lrs_disabled] simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Dec 7, 2020
1 parent 0823971 commit d0a343a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions xds/internal/balancer/edsbalancer/eds_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,6 @@ func (s) TestEDS_LoadReportDisabled(t *testing.T) {
// We create an xdsClientWrapper with a dummy xdsClientInterface which only
// implements the LoadStore() method to return the underlying load.Store to
// be used.
loadStore := load.NewStore()
lsWrapper := &loadStoreWrapper{}
lsWrapper.updateServiceName(testClusterNames[0])
// Not calling lsWrapper.updateLoadStore(loadStore) because LRS is disabled.
Expand Down Expand Up @@ -784,19 +783,11 @@ func (s) TestEDS_LoadReportDisabled(t *testing.T) {

// Test roundrobin with two subconns.
p1 := <-cc.NewPickerCh
// We expect the 10 picks to be split between the localities since they are
// of equal weight. And since we only mark the picks routed to sc2 as done,
// the picks on sc1 should show up as inProgress.
// We call picks to make sure they don't panic.
for i := 0; i < 10; i++ {
scst, _ := p1.Pick(balancer.PickInfo{})
if scst.Done != nil && scst.SubConn != sc1 {
scst.Done(balancer.DoneInfo{})
}
}

var wantStoreData []*load.Data
gotStoreData := loadStore.Stats(testClusterNames[0:1])
if diff := cmp.Diff(wantStoreData, gotStoreData, cmpopts.EquateEmpty(), cmpopts.IgnoreFields(load.Data{}, "ReportInterval")); diff != "" {
t.Errorf("store.stats() returned unexpected diff (-want +got):\n%s", diff)
}
}

0 comments on commit d0a343a

Please sign in to comment.