-
Notifications
You must be signed in to change notification settings - Fork 805
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
[history] fix generated timeout wrapper #5737
[history] fix generated timeout wrapper #5737
Conversation
select { | ||
case <-ctx.Done(): | ||
return nil, ctx.Err() | ||
case <-time.After(time.Millisecond * 100): |
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 somehow use mock time source to avoid relying on time passed? this can cause flakiness
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.
I tried. It's very complicated. The real issue here is incorrect test case with timeout set as 100. A quicker fix would be changing the timeout to 150ms and that should kill the flakiness
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.
yeah let's go with higher number then
Codecov Report
Additional details and impacted filessee 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@@ -3,6 +3,7 @@ import ( | |||
"time" | |||
) | |||
|
|||
{{$exclude := splitList "|" (index .Vars "exclude")}} |
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.
I guess we're hitting the limitations of this templating
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.
Yes, but it's still useful to generate for most handlers.
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.
yeah, no concerns, just musing
t.Run("no timeout", func(t *testing.T) { | ||
m := history.NewMockClient(gomock.NewController(t)) | ||
m.EXPECT().GetReplicationMessages(gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, r *types.GetReplicationMessagesRequest, opt ...yarpc.CallOption) (*types.GetReplicationMessagesResponse, error) { | ||
for { |
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.
sorry, maybe just me being dumb, but I am not sure I understand why this is a loop?
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.
It's for wait and handle the context timeout.
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.
It doesn't matter very much, so this is more a nit comment, but wouldn't jsut the select statement work? Or am I just confused somehow
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.
I think you are right. We don't have default case so it's not really needed.
c714e5a
to
ebe1134
Compare
7b63920
to
0cce260
Compare
Pull Request Test Coverage Report for Build 018e1a72-0b04-4c09-9b2a-83350045a3cdDetails
💛 - Coveralls |
What changed?
#5728 code generated history client should exclude some endpoints.
Why?
Some replication endpoints don't have timeout before
How did you test it?
unit test
Potential risks
Release notes
Documentation Changes