aggregator/pkg/handlers: fix post-teardown log panic#1167
Merged
Conversation
- Replace TestSugared(t) with Nop logger in cancelled-context test; worker goroutines outlive t in Go 1.26+ and panic if they log after teardown
winder
previously approved these changes
Jun 9, 2026
bukata-sa
previously approved these changes
Jun 9, 2026
winder
approved these changes
Jun 9, 2026
|
Code coverage report:
|
bukata-sa
approved these changes
Jun 9, 2026
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.
Description
TestBatchWriteCommitCCVNodeDataHandler_CancelledContextReturnsImmediatelywas frequently panicking in CI with:
The batch handler returns early when the context is cancelled, but the
per-item worker goroutines keep running until they unblock from
CheckAggregation. Those goroutines then log "failed to triggeraggregation" via the
zaptestlogger — which holds a reference to thenow-torn-down
*testing.Tand panics.The fix is test-side only: replace
logger.TestSugared(t)withlogger.Sugared(logger.Nop())in this specific test. The nop logger issafe to call after the test exits. The handler's error log is correct
production behaviour and is intentionally left unchanged.
The panic was seen on two separate CI runs on the same day
(PR #1166 and the merge queue), always with the same message ID,
confirming a deterministic race in the test setup rather than random
flakiness.
Testing
Ran the previously failing test 50 consecutive times with
-count=50:Checklist
changelogdirectory)just lint fix- no new lint errorsjust generate- mocks and protobufs are up to date