diff --git a/blob/service.go b/blob/service.go index 7016269c07..dc85db1132 100644 --- a/blob/service.go +++ b/blob/service.go @@ -131,7 +131,7 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su select { case header, ok := <-headerCh: if ctx.Err() != nil { - log.Debug("blobsub: cancelling subscription due to user context closing") + log.Debug("blobsub: canceling subscription due to user context closing") return } if !ok { @@ -141,7 +141,7 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su blobs, err := s.getAll(ctx, header, []share.Namespace{ns}) if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { // context canceled, continuing would lead to unexpected missed heights for the client - log.Debug("blobsub: cancelling subscription due to user context closing") + log.Debug("blobsub: canceling subscription due to user context closing") return } if err != nil { @@ -151,15 +151,15 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su select { case <-ctx.Done(): - log.Debug("blobsub: cancelling subscription with pending response due to user context closing") + log.Debug("blobsub: canceling subscription with pending response due to user context closing") return case blobCh <- &SubscriptionResponse{Blobs: blobs, Height: header.Height()}: } case <-ctx.Done(): - log.Debug("blobsub: cancelling subscription due to user context closing") + log.Debug("blobsub: canceling subscription due to user context closing") return case <-s.ctx.Done(): - log.Debug("blobsub: cancelling subscription due to service context closing") + log.Debug("blobsub: canceling subscription due to service context closing") return } } diff --git a/blob/service_test.go b/blob/service_test.go index af44ea4ad6..7e8856dde9 100644 --- a/blob/service_test.go +++ b/blob/service_test.go @@ -750,7 +750,8 @@ func TestService_Subscribe(t *testing.T) { // cancel the subscription context after receiving the first response select { case <-subCh: - service.Stop(context.Background()) + err = service.Stop(context.Background()) + require.NoError(t, err) case <-time.After(time.Second * 2): t.Fatal("timeout waiting for first subscription response") } @@ -761,7 +762,6 @@ func TestService_Subscribe(t *testing.T) { case <-time.After(time.Second * 2): t.Fatal("timeout waiting for subscription channel to close") } - }) } @@ -779,6 +779,7 @@ func TestService_Subscribe_MultipleNamespaces(t *testing.T) { blobs2, err := convertBlobs(appBlobs2...) require.NoError(t, err) + // nolint: gocritic allBlobs := append(blobs1, blobs2...) service := createServiceWithSub(ctx, t, allBlobs)