From e0a730c111be689ed220f87f14c0ef7a0bc419a3 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Fri, 25 Oct 2024 09:00:38 -0700 Subject: [PATCH] clusterresolver: fix a comment in a test (#7776) --- .../e2e_test/aggregate_cluster_test.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/xds/internal/balancer/clusterresolver/e2e_test/aggregate_cluster_test.go b/xds/internal/balancer/clusterresolver/e2e_test/aggregate_cluster_test.go index b82e6d09202a..89f3d1bcac71 100644 --- a/xds/internal/balancer/clusterresolver/e2e_test/aggregate_cluster_test.go +++ b/xds/internal/balancer/clusterresolver/e2e_test/aggregate_cluster_test.go @@ -112,7 +112,9 @@ func (s) TestAggregateCluster_WithTwoEDSClusters(t *testing.T) { return nil } if len(req.GetResourceNames()) == 0 { - // This is the case for ACKs. Do nothing here. + // This happens at the end of the test when the grpc channel is + // being shut down and it is no longer interested in xDS + // resources. return nil } select { @@ -489,11 +491,15 @@ func (s) TestAggregateCluster_WithEDSAndDNS(t *testing.T) { if req.GetTypeUrl() != version.V3EndpointsURL { return nil } - if len(req.GetResourceNames()) > 0 { - select { - case edsResourceCh <- req.GetResourceNames()[0]: - default: - } + if len(req.GetResourceNames()) == 0 { + // This happens at the end of the test when the grpc channel is + // being shut down and it is no longer interested in xDS + // resources. + return nil + } + select { + case edsResourceCh <- req.GetResourceNames()[0]: + default: } return nil },