From f0cf288c1375349198f07e5b5028b3808fcdb13e Mon Sep 17 00:00:00 2001 From: Makram Kamaleddine Date: Tue, 9 Jun 2026 19:15:29 +0300 Subject: [PATCH 1/3] aggregator/pkg/handlers: fix post-teardown log panic - 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 --- .../handlers/batch_write_commit_verifier_node_result_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go b/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go index ba5c5604d..98402f0ea 100644 --- a/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go +++ b/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go @@ -225,7 +225,10 @@ func TestBatchWriteCommitCCVNodeDataHandler_CancelledContextReturnsImmediately(t const testChannelKey model.ChannelKey = "test-caller" blockDuration := 5 * time.Second - lggr := logger.TestSugared(t) + // Use a nop logger: worker goroutines that are still running when the context + // is cancelled may log after this test's *testing.T is torn down, which + // panics in Go. A nop logger avoids that without changing the handler. + lggr := logger.Sugared(logger.Nop()) store := mocks.NewMockCommitVerificationStore(t) agg := mocks.NewMockAggregationTriggerer(t) sig := mocks.NewMockSignatureValidator(t) From aca37dbc13df89aedae81c549fa05d88aaa89c55 Mon Sep 17 00:00:00 2001 From: Makram Kamaleddine Date: Tue, 9 Jun 2026 19:23:06 +0300 Subject: [PATCH 2/3] lint --- .../handlers/batch_write_commit_verifier_node_result_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go b/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go index 98402f0ea..848106146 100644 --- a/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go +++ b/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go @@ -226,7 +226,7 @@ func TestBatchWriteCommitCCVNodeDataHandler_CancelledContextReturnsImmediately(t blockDuration := 5 * time.Second // Use a nop logger: worker goroutines that are still running when the context - // is cancelled may log after this test's *testing.T is torn down, which + // is canceled may log after this test's *testing.T is torn down, which // panics in Go. A nop logger avoids that without changing the handler. lggr := logger.Sugared(logger.Nop()) store := mocks.NewMockCommitVerificationStore(t) From bb14b551d42cee373d86a66268557476dd94851c Mon Sep 17 00:00:00 2001 From: Makram Kamaleddine Date: Tue, 9 Jun 2026 19:41:18 +0300 Subject: [PATCH 3/3] use logger.Nop() in rest of tests --- .../batch_write_commit_verifier_node_result_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go b/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go index 848106146..473e394cb 100644 --- a/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go +++ b/aggregator/pkg/handlers/batch_write_commit_verifier_node_result_test.go @@ -64,7 +64,7 @@ func TestBatchWriteCommitCCVNodeDataHandler_BatchSizeValidation(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - lggr := logger.TestSugared(t) + lggr := logger.Sugared(logger.Nop()) store := mocks.NewMockCommitVerificationStore(t) agg := mocks.NewMockAggregationTriggerer(t) sig := mocks.NewMockSignatureValidator(t) @@ -119,7 +119,7 @@ func TestBatchWriteCommitCCVNodeDataHandler_MixedSuccessAndInvalidArgument(t *te const testCallerID = "test-caller" const testChannelKey model.ChannelKey = "test-caller" - lggr := logger.TestSugared(t) + lggr := logger.Sugared(logger.Nop()) store := mocks.NewMockCommitVerificationStore(t) agg := mocks.NewMockAggregationTriggerer(t) @@ -174,7 +174,7 @@ func TestBatchWriteCommitCCVNodeDataHandler_NilRequestAtIndexReturnsInvalidArgum const testCallerID = "test-caller" const testChannelKey model.ChannelKey = "test-caller" - lggr := logger.TestSugared(t) + lggr := logger.Sugared(logger.Nop()) store := mocks.NewMockCommitVerificationStore(t) agg := mocks.NewMockAggregationTriggerer(t) sig := mocks.NewMockSignatureValidator(t)