daemon/logger/fluentd: deflake TestReadWriteTimeoutsAreEffective#52447
Open
firasmosbehi wants to merge 1 commit intomoby:masterfrom
Open
daemon/logger/fluentd: deflake TestReadWriteTimeoutsAreEffective#52447firasmosbehi wants to merge 1 commit intomoby:masterfrom
firasmosbehi wants to merge 1 commit intomoby:masterfrom
Conversation
This test was flaky for two reasons: 1. On macOS, t.TempDir() produces very long paths that exceed the Unix domain socket path length limit (~104 bytes). Fall back to a shorter path under /tmp when needed. 2. The noAckConnectionHandler kept the connection open until the 10-second test context expired. When the fluentd client's read timeout didn't fire promptly, the test hung for the full 10s, sometimes causing the overall test to exceed its timeout. Close the connection after a short delay instead of waiting for the test context. Also increase the per-subtest timeout from 10s to 30s to provide more headroom under CI load. Fixes moby#51079 Signed-off-by: Kimi Code CLI <[email protected]>
thaJeztah
requested changes
Apr 25, 2026
Member
thaJeztah
left a comment
There was a problem hiding this comment.
looks like the DCO sign-off is not correct;
Signed-off-by: Kimi Code CLI <[email protected]>
thaJeztah
reviewed
Apr 25, 2026
| // to a shorter path under /tmp. | ||
| if len(socketFile) > 100 { | ||
| var err error | ||
| tmpDir, err = os.MkdirTemp("/tmp", "fluentd-test") |
Member
There was a problem hiding this comment.
Perhaps we should use "" (use default) or explicitly os.TempDir() here, instead of hard-coding /tmp 🤔
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
Fixed two sources of flakiness in TestReadWriteTimeoutsAreEffective:
Socket path too long on macOS: t.TempDir() on macOS produces paths that exceed the Unix domain socket path length limit (~104 bytes on macOS, ~108 on Linux). The test now falls back to a shorter path under /tmp when the generated path is too long.
10-second hangs in read_timeout subtest: noAckConnectionHandler kept the connection open until the test context expired (10s). When the fluentd client's read timeout didn't fire promptly, the test hung for the full duration, occasionally exceeding the overall test timeout. The handler now closes the connection after a 100ms delay instead of waiting for the test context.
Also increased the per-subtest timeout from 10s to 30s to provide more headroom under CI load.
- How to verify it
go test ./daemon/logger/fluentd/ -v -run TestReadWriteTimeoutsAreEffectiveFixes #51079