Skip to content

Commit 281487c

Browse files
committed
Review comments #1
1 parent 0627552 commit 281487c

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

xds/internal/client/cds_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func TestCDSCaching(t *testing.T) {
370370
}
371371
errCh := testutils.NewChannel()
372372
go testCDSCaching(t, ops, errCh)
373-
waitForNonNilErr(t, errCh)
373+
waitForNilErr(t, errCh)
374374
}
375375

376376
// TestCDSWatchExpiryTimer tests the case where the client does not receive an
@@ -407,7 +407,7 @@ func TestCDSWatchExpiryTimer(t *testing.T) {
407407
if _, err := fakeServer.XDSRequestChan.Receive(); err != nil {
408408
t.Fatalf("Timeout expired when expecting an CDS request")
409409
}
410-
waitForNonNilErr(t, callbackCh)
410+
waitForNilErr(t, callbackCh)
411411
}
412412

413413
var (

xds/internal/client/client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func TestWatchService(t *testing.T) {
150150
t.Fatalf("Timeout expired when expecting an RDS request")
151151
}
152152
fakeServer.XDSResponseChan <- &fakeserver.Response{Resp: goodRDSResponse1}
153-
waitForNonNilErr(t, callbackCh)
153+
waitForNilErr(t, callbackCh)
154154
}
155155

156156
// TestWatchServiceWithNoResponseFromServer tests the case where the
@@ -196,7 +196,7 @@ func TestWatchServiceWithNoResponseFromServer(t *testing.T) {
196196
if _, err := fakeServer.XDSRequestChan.Receive(); err != nil {
197197
t.Fatalf("Timeout expired when expecting an LDS request")
198198
}
199-
waitForNonNilErr(t, callbackCh)
199+
waitForNilErr(t, callbackCh)
200200
}
201201

202202
// TestWatchServiceEmptyRDS tests the case where the underlying
@@ -247,7 +247,7 @@ func TestWatchServiceEmptyRDS(t *testing.T) {
247247
t.Fatalf("Timeout expired when expecting an RDS request")
248248
}
249249
fakeServer.XDSResponseChan <- &fakeserver.Response{Resp: noVirtualHostsInRDSResponse}
250-
waitForNonNilErr(t, callbackCh)
250+
waitForNilErr(t, callbackCh)
251251
}
252252

253253
// TestWatchServiceWithClientClose tests the case where xDS responses are

xds/internal/client/eds_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,5 @@ func TestEDSWatchExpiryTimer(t *testing.T) {
284284
if _, err := fakeServer.XDSRequestChan.Receive(); err != nil {
285285
t.Fatalf("Timeout expired when expecting an CDS request")
286286
}
287-
waitForNonNilErr(t, callbackCh)
287+
waitForNilErr(t, callbackCh)
288288
}

xds/internal/client/lds_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,5 +237,5 @@ func TestLDSWatchExpiryTimer(t *testing.T) {
237237
if _, err := fakeServer.XDSRequestChan.Receive(); err != nil {
238238
t.Fatalf("Timeout expired when expecting an LDS request")
239239
}
240-
waitForNonNilErr(t, callbackCh)
240+
waitForNilErr(t, callbackCh)
241241
}

xds/internal/client/rds_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func doLDS(t *testing.T, v2c *v2Client, fakeServer *fakeserver.Server) {
181181
}
182182

183183
fakeServer.XDSResponseChan <- &fakeserver.Response{Resp: goodLDSResponse1}
184-
waitForNonNilErr(t, cbCh)
184+
waitForNilErr(t, cbCh)
185185

186186
// Read the LDS ack, to clear RequestChan for following tests.
187187
if _, err := fakeServer.XDSRequestChan.Receive(); err != nil {
@@ -420,7 +420,7 @@ func TestRDSCaching(t *testing.T) {
420420
}
421421
errCh := testutils.NewChannel()
422422
go testRDSCaching(t, ops, errCh)
423-
waitForNonNilErr(t, errCh)
423+
waitForNilErr(t, errCh)
424424
}
425425

426426
// TestRDSWatchExpiryTimer tests the case where the client does not receive an
@@ -458,7 +458,7 @@ func TestRDSWatchExpiryTimer(t *testing.T) {
458458
if _, err := fakeServer.XDSRequestChan.Receive(); err != nil {
459459
t.Fatalf("Timeout expired when expecting an RDS request")
460460
}
461-
waitForNonNilErr(t, callbackCh)
461+
waitForNilErr(t, callbackCh)
462462
}
463463

464464
func TestHostFromTarget(t *testing.T) {

xds/internal/client/testutil_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ func startServerAndGetCC(t *testing.T) (*fakeserver.Server, *grpc.ClientConn, fu
152152
}
153153
}
154154

155-
// waitForNonNilErr waits for a non-nil error value to be received on the
155+
// waitForNilErr waits for a nil error value to be received on the
156156
// provided channel.
157-
func waitForNonNilErr(t *testing.T, ch *testutils.Channel) {
157+
func waitForNilErr(t *testing.T, ch *testutils.Channel) {
158158
t.Helper()
159159

160160
val, err := ch.Receive()

0 commit comments

Comments
 (0)