Skip to content

Commit a9ee1a6

Browse files
committed
test without cache verification
1 parent 54380b2 commit a9ee1a6

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

xds/internal/xdsclient/tests/lds_watchers_test.go

+1-41
Original file line numberDiff line numberDiff line change
@@ -950,34 +950,7 @@ func (s) TestLDSWatch_NACKError(t *testing.T) {
950950
// receives both good update and error without a new resource request being
951951
// sent to the management server.
952952
func (s) TestLDSWatch_ResourceCaching_NACKError(t *testing.T) {
953-
firstRequestReceived := false
954-
firstAckReceived := grpcsync.NewEvent()
955-
secondRequestReceived := grpcsync.NewEvent()
956-
957-
mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{
958-
OnStreamRequest: func(id int64, req *v3discoverypb.DiscoveryRequest) error {
959-
// The first request has an empty version string.
960-
if !firstRequestReceived && req.GetVersionInfo() == "" {
961-
firstRequestReceived = true
962-
return nil
963-
}
964-
// The first ack has a non-empty version string.
965-
if !firstAckReceived.HasFired() && req.GetVersionInfo() != "" {
966-
firstAckReceived.Fire()
967-
return nil
968-
}
969-
// If the request version remains "1" while the nonce keeps
970-
// increasing, it indicates the client is repeatedly NACKing
971-
// updates from the server but not sending any new resource
972-
// request.
973-
if req.GetVersionInfo() == "1" {
974-
return nil
975-
}
976-
// Any requests after the first request and ack, are not expected.
977-
secondRequestReceived.Fire()
978-
return nil
979-
},
980-
})
953+
mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{})
981954

982955
nodeID := uuid.New().String()
983956
bc := e2e.DefaultBootstrapContents(t, nodeID, mgmtServer.Address)
@@ -1020,11 +993,6 @@ func (s) TestLDSWatch_ResourceCaching_NACKError(t *testing.T) {
1020993
if err := verifyListenerUpdate(ctx, lw1.updateCh, wantUpdate); err != nil {
1021994
t.Fatal(err)
1022995
}
1023-
select {
1024-
case <-ctx.Done():
1025-
t.Fatal("timeout when waiting for receipt of ACK at the management server")
1026-
case <-firstAckReceived.Done():
1027-
}
1028996

1029997
// Configure the management server to return a single listener resource
1030998
// which is expected to be NACKed by the client.
@@ -1054,14 +1022,6 @@ func (s) TestLDSWatch_ResourceCaching_NACKError(t *testing.T) {
10541022
if err := verifyListenerUpdate(ctx, lw2.updateCh, wantUpdate); err != nil {
10551023
t.Fatal(err)
10561024
}
1057-
// No request should get sent out as part of this watch.
1058-
sCtx, sCancel := context.WithTimeout(ctx, defaultTestShortTimeout)
1059-
defer sCancel()
1060-
select {
1061-
case <-sCtx.Done():
1062-
case <-secondRequestReceived.Done():
1063-
t.Fatal("xdsClient sent out request instead of using update from cache")
1064-
}
10651025
u, err = lw2.updateCh.Receive(ctx)
10661026
if err != nil {
10671027
t.Fatalf("timeout when waiting for a listener resource from the management server: %v", err)

0 commit comments

Comments
 (0)