@@ -67,9 +67,6 @@ func init() {
67
67
// are handled in the run() goroutine, which exits before Close() returns, we
68
68
// expect the above picker update to be dropped.
69
69
func (s ) TestPickerUpdateAfterClose (t * testing.T ) {
70
- defer xdsclient .ClearCounterForTesting (testClusterName , testServiceName )
71
- xdsC := fakeclient .NewClient ()
72
-
73
70
builder := balancer .Get (Name )
74
71
cc := testutils .NewBalancerClientConn (t )
75
72
b := builder .Build (cc , balancer.BuildOptions {})
@@ -104,6 +101,7 @@ func (s) TestPickerUpdateAfterClose(t *testing.T) {
104
101
})
105
102
106
103
var maxRequest uint32 = 50
104
+ xdsC := fakeclient .NewClient ()
107
105
if err := b .UpdateClientConnState (balancer.ClientConnState {
108
106
ResolverState : xdsclient .SetClient (resolver.State {Endpoints : testBackendEndpoints }, xdsC ),
109
107
BalancerConfig : & LBConfig {
@@ -140,14 +138,12 @@ func (s) TestClusterNameInAddressAttributes(t *testing.T) {
140
138
ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
141
139
defer cancel ()
142
140
143
- defer xdsclient .ClearCounterForTesting (testClusterName , testServiceName )
144
- xdsC := fakeclient .NewClient ()
145
-
146
141
builder := balancer .Get (Name )
147
142
cc := testutils .NewBalancerClientConn (t )
148
143
b := builder .Build (cc , balancer.BuildOptions {})
149
144
defer b .Close ()
150
145
146
+ xdsC := fakeclient .NewClient ()
151
147
if err := b .UpdateClientConnState (balancer.ClientConnState {
152
148
ResolverState : xdsclient .SetClient (resolver.State {Endpoints : testBackendEndpoints }, xdsC ),
153
149
BalancerConfig : & LBConfig {
@@ -237,9 +233,6 @@ func (s) TestPickerUpdatedSynchronouslyOnConfigUpdate(t *testing.T) {
237
233
}
238
234
defer func () { clientConnUpdateHook = origClientConnUpdateHook }()
239
235
240
- defer xdsclient .ClearCounterForTesting (testClusterName , testServiceName )
241
- xdsC := fakeclient .NewClient ()
242
-
243
236
builder := balancer .Get (Name )
244
237
cc := testutils .NewBalancerClientConn (t )
245
238
b := builder .Build (cc , balancer.BuildOptions {})
@@ -257,6 +250,7 @@ func (s) TestPickerUpdatedSynchronouslyOnConfigUpdate(t *testing.T) {
257
250
},
258
251
})
259
252
253
+ xdsC := fakeclient .NewClient ()
260
254
if err := b .UpdateClientConnState (balancer.ClientConnState {
261
255
ResolverState : xdsclient .SetClient (resolver.State {Endpoints : testBackendEndpoints }, xdsC ),
262
256
BalancerConfig : & LBConfig {
0 commit comments