Skip to content

Commit

Permalink
kvserver: improve a test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andreimatei committed May 13, 2021
1 parent 0a040d6 commit 1bf8d6f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/replica_closedts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1bf8d6f

Please sign in to comment.