@@ -50,11 +50,7 @@ func TestDistSenderReplicaStall(t *testing.T) {
50
50
}
51
51
52
52
testutils .RunTrueAndFalse (t , "clientTimeout" , func (t * testing.T , clientTimeout bool ) {
53
- ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
54
- defer time .AfterFunc (29 * time .Second , func () {
55
- log .Errorf (ctx , "about to time out, all stacks:\n \n %s" , allstacks .Get ())
56
- }).Stop ()
57
- defer cancel ()
53
+ ctx := context .Background ()
58
54
59
55
// The lease won't move unless we use expiration-based leases. We also
60
56
// speed up the test by reducing various intervals and timeouts.
@@ -89,6 +85,12 @@ func TestDistSenderReplicaStall(t *testing.T) {
89
85
desc := tc .AddVotersOrFatal (t , key , tc .Targets (1 , 2 )... )
90
86
t .Logf ("created %s" , desc )
91
87
88
+ ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
89
+ defer time .AfterFunc (29 * time .Second , func () {
90
+ log .Errorf (ctx , "about to time out, all stacks:\n \n %s" , allstacks .Get ())
91
+ }).Stop ()
92
+ defer cancel ()
93
+
92
94
// Move the lease to n3, and make sure everyone has applied it by
93
95
// replicating a write.
94
96
tc .TransferRangeLeaseOrFatal (t , desc , tc .Target (2 ))
0 commit comments