daemon/logger: refactor followLogs and replace flaky TestFollowLogsHandleDecodeErr#43105
Merged
cpuguy83 merged 2 commits intomoby:masterfrom Jan 12, 2022
Merged
daemon/logger: refactor followLogs and replace flaky TestFollowLogsHandleDecodeErr#43105cpuguy83 merged 2 commits intomoby:masterfrom
cpuguy83 merged 2 commits intomoby:masterfrom
Conversation
added 2 commits
December 27, 2021 09:11
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 <[email protected]>
Signed-off-by: Kazuyoshi Kato <[email protected]>
Member
|
Failure on windows looks like a flaky test; #38521 (I'll kick ci) |
thaJeztah
approved these changes
Jan 4, 2022
Member
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM
@cpuguy83 @samuelkarp ptal
Member
|
(added cherry-pick label, as this is a follow-up / fix for changes in #43043) |
Member
|
@cpuguy83 ptal 🤗 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- 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)

(from https://www.bbc.co.uk/programmes/p05rkdmp)