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

xdsclient: make load reporting tests e2e style (3/N) #7694

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Oct 2, 2024

This PR moves load reporting tests from the transport and xdsclient package to live in the xdsclient/tests package and makes them e2e style.

#a71-xds-fallback
#xdsclient-refactor

Addresses #6902

RELEASE NOTES: none

@easwars easwars changed the title xdsclient: make load reporting tests e2e style xdsclient: make load reporting tests e2e style (3/N) Oct 2, 2024
@easwars easwars requested review from purnesh42H and zasweq October 2, 2024 17:52
@easwars easwars added this to the 1.68 Release milestone Oct 2, 2024
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.89%. Comparing base (98d1550) to head (a4ca214).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7694      +/-   ##
==========================================
+ Coverage   81.80%   81.89%   +0.08%     
==========================================
  Files         361      361              
  Lines       27827    27827              
==========================================
+ Hits        22765    22790      +25     
+ Misses       3861     3844      -17     
+ Partials     1201     1193       -8     

see 18 files with indirect coverage changes

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 overall, minor comments.

xds/internal/xdsclient/tests/loadreport_test.go Outdated Show resolved Hide resolved
xds/internal/xdsclient/tests/loadreport_test.go Outdated Show resolved Hide resolved
xds/internal/xdsclient/tests/loadreport_test.go Outdated Show resolved Hide resolved
xds/internal/xdsclient/tests/loadreport_test.go Outdated Show resolved Hide resolved
for {
u, err := lrsServer.LRSRequestChan.Receive(ctx)
if err != nil {
t.Fatalf("Timeout when reading LRS request: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment to other PR about the error case when in a polling loop. I think the correct failure for this whole polling loop, perhaps not a failure in this specific operation is that it's a timeout for server waiting for a stream canceled error. I'd like to see that logic weaved in somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the error message here. As I mentioned in the similar comment on the other PR, this check will fail when the test timeout expires.

Also, changed the call on line 243 to be t.Fatalf. So, if the server sees any other error code, the test will fail immediately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I just felt like it should be a distinct error/string for failure when the polling loop expires, and not leave it to fail in an operation within the polling loop that is a layer under (i.e. this timeout when reading LRS request failures).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah your diff is what I was going for. I wish there was a way to wrap it fully, where the whole polling loop if it hits timeout will fail with that error rather than failing with this error, but it's minor and this single conditional add is simple and does the job mostly well.

xds/internal/xdsclient/tests/loadreport_test.go Outdated Show resolved Hide resolved
@zasweq zasweq assigned easwars and unassigned zasweq Oct 4, 2024
@easwars easwars assigned zasweq and unassigned easwars Oct 4, 2024
// with different server configurations
// - canceling the load reporting from the client results in the LRS stream
// being canceled on the server
func (s) TestReportLoad_ConnectionCreation(t *testing.T) {
Copy link
Contributor

@purnesh42H purnesh42H Oct 7, 2024

Choose a reason for hiding this comment

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

Do we not need any failure test cases like "Handling errors returned from the server during load reporting by client"?

@zasweq
Copy link
Contributor

zasweq commented Oct 7, 2024

Still LGTM.

@easwars easwars merged commit 3adcd41 into grpc:master Oct 7, 2024
14 checks passed
@easwars easwars deleted the loadreport_tests branch October 7, 2024 23:25
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.

3 participants