Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csds: unskip e2e test #7502

Merged
merged 7 commits into from
Aug 15, 2024
Merged

csds: unskip e2e test #7502

merged 7 commits into from
Aug 15, 2024

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Aug 12, 2024

This PR unskips a test which was previously failing on arm64 because the xDS client was being overwhelmed by the go-control-plane management server, because the latter was continuously resending NACKed resources. This PR uses the ADS stream level flow control mechanism from the resource watchers used in the test, and thereby will be able to throttle receipt of messages from the management server.

Fixes #7383

RELEASE NOTES: none

@easwars easwars added this to the 1.66 Release milestone Aug 12, 2024
@easwars easwars requested a review from zasweq August 12, 2024 15:46
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.93%. Comparing base (7ec3fd2) to head (6685729).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7502      +/-   ##
==========================================
+ Coverage   81.66%   81.93%   +0.27%     
==========================================
  Files         359      360       +1     
  Lines       27531    27533       +2     
==========================================
+ Hits        22484    22560      +76     
+ Misses       3824     3782      -42     
+ Partials     1223     1191      -32     

see 39 files with indirect coverage changes

// useful when a resource is NACKed, because the go-control-plane management
// server continuously resends the same resource in this case, and applying flow
// control from these watchers ensures that xDS client does not spend all of its
// time receiving and NACKing updates from the maangement server. This was
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

management

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// indeed the case on arm64 (before we had support for ADS stream level flow
// control), and was causing CSDS to not receive any updates in this case.

func blockAndDone(testDoneCh <-chan struct{}, waitCh chan struct{}, onDone xdsresource.DoneNotifier) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write a comment explaining what this function does? Or encode it in the function name? I don't think blockAndDone describes what is going on here. Something along the lines of calls onDone if test finishes or signaled through waitCh.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I was supposed to write a comment for this. Totally forgot. Thanks.

@@ -332,6 +406,9 @@ func (s) TestCSDS(t *testing.T) {
t.Fatal(err)
}

// Unblock the resource watchers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional here and below: delete this since just repeating the function name?


type blockingListenerWatcher struct {
testDoneCh <-chan struct{} // Closed when the test is done.
waitCh chan struct{} // Written to by the test to unblock the watch callback.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: here, other watchers, and the helper unblockResourceWatchers. "wait" to me is encoded implicitly in the semantics of a go channel. Perhaps call this onDoneCh? triggerOnDoneCh? watchCallbackCh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks.

@zasweq zasweq assigned easwars and unassigned zasweq Aug 12, 2024
@easwars
Copy link
Contributor Author

easwars commented Aug 14, 2024

@zasweq : Do you mind taking another look. Based on our offline discussion, I split the tests into two. The second one now deals with NACKs, but is simpler because it only deals with one resource type.

@easwars easwars assigned zasweq and unassigned easwars Aug 14, 2024
Copy link
Contributor

@zasweq zasweq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

// Tests CSDS functionality. The test performs the following:
// - Spins up a management server and creates two xDS clients talking to it.
// - Registers one watch on each xDS client, and verifies that the CSDS
// response reports resources in REQUESTED state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In between REQUESTED and NACK you also test if both of them are in ACKED state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 150 to 152
// writeOnDone attempts to writes the onDone callback on the onDone
// channel. It returns when it can successfully write to the channel or when the
// test is done, which is signalled by testCtxDone being closed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap to 80 chars please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@zasweq zasweq assigned easwars and unassigned zasweq Aug 15, 2024
@easwars easwars merged commit 86135c3 into grpc:master Aug 15, 2024
13 checks passed
@easwars easwars deleted the unskip_csds_test branch August 15, 2024 19:48
infovivek2020 pushed a commit to infovivek2020/grpc-go that referenced this pull request Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xds/csds: unskip test after ADS stream flow control changes are merged
2 participants