-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Populate total_issued_requests count in LRS load report #7544
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,8 +156,14 @@ func (s) TestDropByCategory(t *testing.T) { | |
if err != nil || gotSCSt.SubConn != sc1 { | ||
return fmt.Errorf("picker.Pick, got %v, %v, want SubConn=%v", gotSCSt, err, sc1) | ||
} | ||
if gotSCSt.Done != nil { | ||
if gotSCSt.Done == nil { | ||
continue | ||
} | ||
// Fail half of the requests that are not dropped. | ||
if i%4 == 1 { | ||
gotSCSt.Done(balancer.DoneInfo{}) | ||
} else { | ||
gotSCSt.Done(balancer.DoneInfo{Err: fmt.Errorf("test error")}) | ||
} | ||
} | ||
return nil | ||
|
@@ -178,7 +184,8 @@ func (s) TestDropByCategory(t *testing.T) { | |
Drops: map[string]uint64{dropReason: dropCount}, | ||
LocalityStats: map[string]load.LocalityData{ | ||
assertString(xdsinternal.LocalityID{}.ToString): {RequestStats: load.RequestData{ | ||
Succeeded: rpcCount - dropCount, | ||
Succeeded: (rpcCount - dropCount) / 2, | ||
Errored: (rpcCount - dropCount) / 2, | ||
Issued: rpcCount - dropCount, | ||
}}, | ||
}, | ||
|
@@ -338,7 +345,9 @@ func (s) TestDropCircuitBreaking(t *testing.T) { | |
} | ||
dones = append(dones, func() { | ||
if gotSCSt.Done != nil { | ||
gotSCSt.Done(balancer.DoneInfo{}) | ||
// Fail these requests to test error counts in the load | ||
// report. | ||
gotSCSt.Done(balancer.DoneInfo{Err: fmt.Errorf("test error")}) | ||
} | ||
}) | ||
} | ||
|
@@ -363,7 +372,8 @@ func (s) TestDropCircuitBreaking(t *testing.T) { | |
TotalDrops: uint64(maxRequest), | ||
LocalityStats: map[string]load.LocalityData{ | ||
assertString(xdsinternal.LocalityID{}.ToString): {RequestStats: load.RequestData{ | ||
Succeeded: uint64(rpcCount - maxRequest + 50), | ||
Succeeded: uint64(rpcCount - maxRequest), | ||
Errored: 50, | ||
Issued: uint64(rpcCount - maxRequest + 50), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there no tests that include failed calls? It would be nice to have at least one test case where succeeded != issued. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed a couple of test cases to have both errors and successful RPCs. |
||
}}, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it so these aren't the same? I.e. if we reversed the two in code then the test would still pass. E.g. make it fail 1/4th and succeed in 3/4ths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.