Skip to content

Commit

Permalink
test without cache verification
Browse files Browse the repository at this point in the history
  • Loading branch information
purnesh42H committed Nov 18, 2024
1 parent 54380b2 commit a9ee1a6
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions xds/internal/xdsclient/tests/lds_watchers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,34 +950,7 @@ func (s) TestLDSWatch_NACKError(t *testing.T) {
// receives both good update and error without a new resource request being
// sent to the management server.
func (s) TestLDSWatch_ResourceCaching_NACKError(t *testing.T) {
firstRequestReceived := false
firstAckReceived := grpcsync.NewEvent()
secondRequestReceived := grpcsync.NewEvent()

mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{
OnStreamRequest: func(id int64, req *v3discoverypb.DiscoveryRequest) error {
// The first request has an empty version string.
if !firstRequestReceived && req.GetVersionInfo() == "" {
firstRequestReceived = true
return nil
}
// The first ack has a non-empty version string.
if !firstAckReceived.HasFired() && req.GetVersionInfo() != "" {
firstAckReceived.Fire()
return nil
}
// If the request version remains "1" while the nonce keeps
// increasing, it indicates the client is repeatedly NACKing
// updates from the server but not sending any new resource
// request.
if req.GetVersionInfo() == "1" {
return nil
}
// Any requests after the first request and ack, are not expected.
secondRequestReceived.Fire()
return nil
},
})
mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{})

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

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

0 comments on commit a9ee1a6

Please sign in to comment.