Repository navigation
fix: enable goleak in chatd tests - #26335
Merged
Merged
Conversation
mafredri
approved these changes
Jun 16, 2026
mafredri
left a comment
Member
There was a problem hiding this comment.
t.Cleanup -> defer, otherwise LGTM 👍🏻
| t.Parallel() | ||
|
|
||
| buffer := messagepartbuffer.New(messagepartbuffer.Options{}) | ||
| t.Cleanup(buffer.Close) |
Member
There was a problem hiding this comment.
Suggested change
| t.Cleanup(buffer.Close) | |
| defer buffer.Close() |
Nit: Prefer defer as if writing regular Go code. Using t.Cleanup mixed with defers (the common path) breaks the expectation of order of events.
| otherRunnerID := uuid.New() | ||
| f.acquireChat(t, chat.ID, otherWorkerID, otherRunnerID) | ||
| recorder := newTaskSideEffectRecorder() | ||
| starter := newTestTaskStarter(t, f, messagepartbuffer.New(messagepartbuffer.Options{}), recorder) |
Member
There was a problem hiding this comment.
It might make sense to just move messagepartbuffer.New to newTestTaskStarter and do the cleanup there?
hugodutka
force-pushed
the
hugodutka/chatd-enable-goleak
branch
from
June 16, 2026 12:23
c77a4a1 to
9f306d0
Compare
hugodutka
enabled auto-merge (squash)
June 16, 2026 12:24
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Enable goleak in chatd tests and fix some leaks. Addresses #26109 (comment)