diff --git a/pkg/storage/consistency_queue.go b/pkg/storage/consistency_queue.go index 8e2f6942686a..c522aed3f41d 100644 --- a/pkg/storage/consistency_queue.go +++ b/pkg/storage/consistency_queue.go @@ -102,9 +102,17 @@ func (q *consistencyQueue) process( if q.interval() <= 0 { return nil } + + // We only need this variable in the `pErr != nil` branch below, but for + // better testing coverage it was moved here. + var shouldQuiesce bool + select { + case <-repl.store.Stopper().ShouldQuiesce(): + shouldQuiesce = true + } + req := roachpb.CheckConsistencyRequest{} if _, pErr := repl.CheckConsistency(ctx, req); pErr != nil { - _, shouldQuiesce := <-repl.store.Stopper().ShouldQuiesce() if !shouldQuiesce || !grpcutil.IsClosedConnection(pErr.GoError()) { // Suppress noisy errors about closed GRPC connections when the // server is quiescing.