Skip to content

Commit e432e76

Browse files
committed
kvcoord: add debugging for TestDistSenderReplicaStall
Dump the stacks if the test is about to time out. This will help with investigations such as: #140957 #146054 Epic: none
1 parent c0ae46f commit e432e76

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/kv/kvclient/kvcoord/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ go_test(
218218
"//pkg/testutils/testcluster",
219219
"//pkg/util",
220220
"//pkg/util/admission/admissionpb",
221+
"//pkg/util/allstacks",
221222
"//pkg/util/caller",
222223
"//pkg/util/ctxgroup",
223224
"//pkg/util/encoding",

pkg/kv/kvclient/kvcoord/dist_sender_circuit_breaker_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/cockroachdb/cockroach/pkg/testutils"
2525
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
2626
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
27+
"github.com/cockroachdb/cockroach/pkg/util/allstacks"
2728
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
2829
"github.com/cockroachdb/cockroach/pkg/util/log"
2930
"github.com/cockroachdb/cockroach/pkg/util/stop"
@@ -50,6 +51,9 @@ func TestDistSenderReplicaStall(t *testing.T) {
5051

5152
testutils.RunTrueAndFalse(t, "clientTimeout", func(t *testing.T, clientTimeout bool) {
5253
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()
5357
defer cancel()
5458

5559
// The lease won't move unless we use expiration-based leases. We also

0 commit comments

Comments
 (0)