Add test suite for LogReader
implementations
#43231
Closed
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
I wrote a comprehensive unit test suite for interface
logger.LogReader
which verifies that any implementation behaves like the json-file driver. I tested both the json-file and local drivers and fixed some bugs which the tests hit. Some of the fixes improve the situation for #39274 as the daemon no longer logs any logging-driver errors anddocker logs --follow
no longer exits early, but the container logs are still not followed across rotations on Windows Server 2022. The log writing is no longer broken by watching the logs, at least: interrupting the command and runningdocker logs
again prints the most recent logs.This PR will be followed up by a rewrite of the journald driver's LogReader implementation (#43219) which passes this test suite and fixes all the known bugs listed in #38859, including the "impossible to implement entirely correct" ones.
- Description for the changelog
local
log driver- A picture of a cute animal (not mandatory but encouraged)