From 1bf8d6f8ca152f954597a99e897c7cad8a0e75ce Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Thu, 13 May 2021 16:08:21 -0400 Subject: [PATCH] kvserver: improve a test In case the test in question fails (which is no longer expected since the previous commit), don't deadlock because of a deferred function waiting for the finish of an operation that will never be triggered to finish. This patch triggers the respective operation. Release note: None --- pkg/kv/kvserver/replica_closedts_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kv/kvserver/replica_closedts_test.go b/pkg/kv/kvserver/replica_closedts_test.go index 0974754b0da9..cc0c39c6c624 100644 --- a/pkg/kv/kvserver/replica_closedts_test.go +++ b/pkg/kv/kvserver/replica_closedts_test.go @@ -602,6 +602,7 @@ func TestRejectedLeaseDoesntDictateClosedTimestamp(t *testing.T) { select { case <-leaseAcqCh: case err := <-leaseAcqErrCh: + close(leaseTransferCh) t.Fatalf("lease request unexpectedly finished. err: %v", err) } // Let the previously blocked transfer succeed. n2's lease acquisition remains