-
Notifications
You must be signed in to change notification settings - Fork 132
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
[internal] Improve code coverage of internal_task_pollers.go #1373
[internal] Improve code coverage of internal_task_pollers.go #1373
Conversation
6427c91
to
c189829
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Continue to review full report in Codecov by Sentry.
|
4bc9f81
to
a85110d
Compare
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.
Only minor stuff to change I think:
- just add the dependencies so it keeps working. I'll switch it to a grep afterward.
opts
maybe? I kinda see why you did it, just not sure it's worth it- tracelog needs an err check at least, probably minor changes
- minor test precision since "panics" is extremely broad about what it's checking for
otherwise LGTM, breaking that up seems like a solid improvement 👍
@@ -365,10 +372,10 @@ func (wtp *workflowTaskPoller) processWorkflowTask(task *workflowTask) error { | |||
if completedRequest == nil && err == nil { | |||
return nil | |||
} | |||
if _, ok := err.(decisionHeartbeatError); ok { | |||
if errors.As(err, new(*decisionHeartbeatError)) { |
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.
yea, looks good - it's only returned from one place right now, and no wrapping, so this won't change behavior 👍
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.
This was not working before at all.
The error was returned as &decicisionHeartbeatError so type assertion err.(decisionHeartbeatError) was always false.
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.
ah, good point. and good fix 👍
Co-authored-by: Steven L <[email protected]>
Co-authored-by: Steven L <[email protected]>
59c7815
to
a01a625
Compare
Does a couple things: - `make generate` now infers files that might affect generation. This should work as long as we keep simple codegen (the server has moved beyond this, sadly). - `make generate` now forces re-generation regardless of need, because it's a nice workaround for dependency issues like happened in uber-go#1373 - `make test` and related targets now go-generate and fmt before running tests. Slower, but you can't forget to re-generate, and they're slow already so it's probably fine.
Does a couple things: - `make $(BUILD)/generate` now infers files that might affect generation. This should work as long as we keep simple codegen (the server has moved beyond this, sadly). - `make generate` now forces re-generation regardless of need, because it's a nice workaround for dependency issues like happened in #1373 - `make test` and related targets now go-generate and fmt before running tests. Slower, but you can't forget to re-generate, and they're slow already so it's probably fine.
What changed?
Refactored task pollers and improve code coverage.
Why?
Improvign code coverage.
How did you test it?
unit tests
Potential risks