Skip to content

Commit

Permalink
tests: fix spelling of variable (#5966)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylejb authored Jan 25, 2023
1 parent a6376c9 commit e2d69aa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
16 changes: 8 additions & 8 deletions xds/internal/balancer/clusterresolver/clusterresolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
const (
defaultTestTimeout = 5 * time.Second
defaultTestShortTimeout = 10 * time.Millisecond
testEDSServcie = "test-eds-service-name"
testEDSService = "test-eds-service-name"
testClusterName = "test-cluster-name"
testClusterName2 = "google_cfe_some-name"
)
Expand Down Expand Up @@ -104,7 +104,7 @@ func (t *noopTestClientConn) NewSubConn([]resolver.Address, balancer.NewSubConnO
return nil, nil
}

func (noopTestClientConn) Target() string { return testEDSServcie }
func (noopTestClientConn) Target() string { return testEDSService }

type scStateChange struct {
sc balancer.SubConn
Expand Down Expand Up @@ -234,7 +234,7 @@ func (s) TestSubConnStateChange(t *testing.T) {

if err := edsB.UpdateClientConnState(balancer.ClientConnState{
ResolverState: xdsclient.SetClient(resolver.State{}, xdsC),
BalancerConfig: newLBConfigWithOneEDS(testEDSServcie),
BalancerConfig: newLBConfigWithOneEDS(testEDSService),
}); err != nil {
t.Fatalf("edsB.UpdateClientConnState() failed: %v", err)
}
Expand Down Expand Up @@ -282,7 +282,7 @@ func (s) TestErrorFromXDSClientUpdate(t *testing.T) {
defer cancel()
if err := edsB.UpdateClientConnState(balancer.ClientConnState{
ResolverState: xdsclient.SetClient(resolver.State{}, xdsC),
BalancerConfig: newLBConfigWithOneEDS(testEDSServcie),
BalancerConfig: newLBConfigWithOneEDS(testEDSService),
}); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -336,7 +336,7 @@ func (s) TestErrorFromXDSClientUpdate(t *testing.T) {
// An update with the same service name should not trigger a new watch.
if err := edsB.UpdateClientConnState(balancer.ClientConnState{
ResolverState: xdsclient.SetClient(resolver.State{}, xdsC),
BalancerConfig: newLBConfigWithOneEDS(testEDSServcie),
BalancerConfig: newLBConfigWithOneEDS(testEDSService),
}); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -370,7 +370,7 @@ func (s) TestErrorFromResolver(t *testing.T) {
defer cancel()
if err := edsB.UpdateClientConnState(balancer.ClientConnState{
ResolverState: xdsclient.SetClient(resolver.State{}, xdsC),
BalancerConfig: newLBConfigWithOneEDS(testEDSServcie),
BalancerConfig: newLBConfigWithOneEDS(testEDSService),
}); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -421,7 +421,7 @@ func (s) TestErrorFromResolver(t *testing.T) {
// the previous watch was canceled.
if err := edsB.UpdateClientConnState(balancer.ClientConnState{
ResolverState: xdsclient.SetClient(resolver.State{}, xdsC),
BalancerConfig: newLBConfigWithOneEDS(testEDSServcie),
BalancerConfig: newLBConfigWithOneEDS(testEDSService),
}); err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -549,7 +549,7 @@ func (s) TestOutlierDetection(t *testing.T) {
// level.
if err := edsB.UpdateClientConnState(balancer.ClientConnState{
ResolverState: xdsclient.SetClient(resolver.State{}, xdsC),
BalancerConfig: newLBConfigWithOneEDSAndOutlierDetection(testEDSServcie, noopODCfg),
BalancerConfig: newLBConfigWithOneEDSAndOutlierDetection(testEDSService, noopODCfg),
}); err != nil {
t.Fatal(err)
}
Expand Down
8 changes: 4 additions & 4 deletions xds/internal/balancer/clusterresolver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func TestParseConfig(t *testing.T) {
LoadReportingServer: testLRSServerConfig,
MaxConcurrentRequests: newUint32(testMaxRequests),
Type: DiscoveryMechanismTypeEDS,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
},
XDSLBPolicy: nil,
Expand All @@ -204,7 +204,7 @@ func TestParseConfig(t *testing.T) {
LoadReportingServer: testLRSServerConfig,
MaxConcurrentRequests: newUint32(testMaxRequests),
Type: DiscoveryMechanismTypeEDS,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
{
Type: DiscoveryMechanismTypeLogicalDNS,
Expand All @@ -224,7 +224,7 @@ func TestParseConfig(t *testing.T) {
LoadReportingServer: testLRSServerConfig,
MaxConcurrentRequests: newUint32(testMaxRequests),
Type: DiscoveryMechanismTypeEDS,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
},
XDSLBPolicy: &internalserviceconfig.BalancerConfig{
Expand All @@ -244,7 +244,7 @@ func TestParseConfig(t *testing.T) {
LoadReportingServer: testLRSServerConfig,
MaxConcurrentRequests: newUint32(testMaxRequests),
Type: DiscoveryMechanismTypeEDS,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
},
XDSLBPolicy: &internalserviceconfig.BalancerConfig{
Expand Down
4 changes: 2 additions & 2 deletions xds/internal/balancer/clusterresolver/configbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,12 @@ func TestPriorityLocalitiesToClusterImpl(t *testing.T) {
mechanism: DiscoveryMechanism{
Cluster: testClusterName,
Type: DiscoveryMechanismTypeEDS,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
// lrsServer is nil, so LRS policy will not be used.
wantConfig: &clusterimpl.LBConfig{
Cluster: testClusterName,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
ChildPolicy: &internalserviceconfig.BalancerConfig{
Name: weightedtarget.Name,
Config: &weightedtarget.LBConfig{
Expand Down
3 changes: 1 addition & 2 deletions xds/internal/balancer/clusterresolver/priority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ func setupTestEDS(t *testing.T, initChild *internalserviceconfig.BalancerConfig)
xdsC := fakeclient.NewClientWithName(testBalancerNameFooBar)
cc := testutils.NewTestClientConn(t)
builder := balancer.Get(Name)
// TODO: @kylejb will fix typo for 'testEDSServcie' in another PR
edsb := builder.Build(cc, balancer.BuildOptions{Target: resolver.Target{URL: *testutils.MustParseURL("dns:///" + testEDSServcie)}})
edsb := builder.Build(cc, balancer.BuildOptions{Target: resolver.Target{URL: *testutils.MustParseURL("dns:///" + testEDSService)}})
if edsb == nil {
t.Fatalf("builder.Build(%s) failed and returned nil", Name)
}
Expand Down
18 changes: 9 additions & 9 deletions xds/internal/balancer/clusterresolver/resource_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ func (s) TestResourceResolverOneEDSResource(t *testing.T) {
}{
{name: "watch EDS",
clusterName: testClusterName,
edsName: testEDSServcie,
wantName: testEDSServcie,
edsName: testEDSService,
wantName: testEDSService,
edsUpdate: testEDSUpdates[0],
want: []priorityConfig{{
mechanism: DiscoveryMechanism{
Type: DiscoveryMechanismTypeEDS,
Cluster: testClusterName,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
edsResp: testEDSUpdates[0],
childNameGen: newNameGenerator(0),
Expand Down Expand Up @@ -123,7 +123,7 @@ func (s) TestResourceResolverOneEDSResource(t *testing.T) {
t.Fatalf("xdsClient.CancelCDS failed with error: %v", err)
}
if edsNameCanceled != test.wantName {
t.Fatalf("xdsClient.CancelEDS called for %v, want: %v", edsNameCanceled, testEDSServcie)
t.Fatalf("xdsClient.CancelEDS called for %v, want: %v", edsNameCanceled, testEDSService)
}
})
}
Expand Down Expand Up @@ -225,16 +225,16 @@ func (s) TestResourceResolverChangeEDSName(t *testing.T) {
rr.updateMechanisms([]DiscoveryMechanism{{
Type: DiscoveryMechanismTypeEDS,
Cluster: testClusterName,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
}})
ctx, ctxCancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer ctxCancel()
gotEDSName1, err := fakeClient.WaitForWatchEDS(ctx)
if err != nil {
t.Fatalf("xdsClient.WatchCDS failed with error: %v", err)
}
if gotEDSName1 != testEDSServcie {
t.Fatalf("xdsClient.WatchEDS called for cluster: %v, want: %v", gotEDSName1, testEDSServcie)
if gotEDSName1 != testEDSService {
t.Fatalf("xdsClient.WatchEDS called for cluster: %v, want: %v", gotEDSName1, testEDSService)
}

// Invoke callback, should get an update.
Expand All @@ -245,7 +245,7 @@ func (s) TestResourceResolverChangeEDSName(t *testing.T) {
mechanism: DiscoveryMechanism{
Type: DiscoveryMechanismTypeEDS,
Cluster: testClusterName,
EDSServiceName: testEDSServcie,
EDSServiceName: testEDSService,
},
edsResp: testEDSUpdates[0],
childNameGen: newNameGenerator(0),
Expand All @@ -266,7 +266,7 @@ func (s) TestResourceResolverChangeEDSName(t *testing.T) {
t.Fatalf("xdsClient.CancelCDS failed with error: %v", err)
}
if edsNameCanceled1 != gotEDSName1 {
t.Fatalf("xdsClient.CancelEDS called for %v, want: %v", edsNameCanceled1, testEDSServcie)
t.Fatalf("xdsClient.CancelEDS called for %v, want: %v", edsNameCanceled1, testEDSService)
}
gotEDSName2, err := fakeClient.WaitForWatchEDS(ctx)
if err != nil {
Expand Down

0 comments on commit e2d69aa

Please sign in to comment.