-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
daemon/logger: refactor followLogs and replace flaky TestFollowLogsHandleDecodeErr #43105
Conversation
followLogs() is getting really long (170+ lines) and complex. The function has multiple inner functions that mutate its variables. To refactor the function, this change introduces follow{} struct. The inner functions are now defined as ordinal methods, which are accessible from tests. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
Failure on windows looks like a flaky test; #38521 (I'll kick ci)
|
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.
LGTM
@cpuguy83 @samuelkarp ptal
(added cherry-pick label, as this is a follow-up / fix for changes in #43043) |
@cpuguy83 ptal 🤗 |
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.
LGTM
- What I did
This PR refactors followLogs and replaces flaky TestFollowLogsHandleDecodeErr by adding a small more focused test.
- How I did it
The first commit is refactoring. The second commit is removing the flaky test and adding a new one.
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
![p05qznn1](https://user-images.githubusercontent.com/19111/147325480-078ca6f7-ef2d-4582-bc4a-70c1dcbcd004.jpg)
(from https://www.bbc.co.uk/programmes/p05rkdmp)