Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: deflake and unskip split race uninit rhs #98715

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions pkg/kv/kvserver/client_split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/ts"
Expand Down Expand Up @@ -2025,7 +2024,6 @@ func TestStoreSplitGCHint(t *testing.T) {
// and the uninitialized replica reacting to messages.
func TestStoreRangeSplitRaceUninitializedRHS(t *testing.T) {
defer leaktest.AfterTest(t)()
skip.WithIssue(t, 66480, "flaky test")
defer log.Scope(t).Close(t)

currentTrigger := make(chan *roachpb.SplitTrigger, 1)
Expand Down Expand Up @@ -2103,6 +2101,7 @@ func TestStoreRangeSplitRaceUninitializedRHS(t *testing.T) {

for i := 0; i < 10; i++ {
errChan := make(chan *kvpb.Error)
failedSendLog := log.Every(time.Second)

// Closed when the split goroutine is done.
splitDone := make(chan struct{})
Expand Down Expand Up @@ -2147,7 +2146,15 @@ func TestStoreRangeSplitRaceUninitializedRHS(t *testing.T) {
Term: term,
},
}, rpc.DefaultClass); !sent {
t.Error("transport failed to send vote request")
// SendAsync can return false, indicating the message didn't send.
// The most likely reason this test encounters a message failing to
// send is the outgoing message queue being full. The queue filling
// up is expected given it has fixed capacity and this loop is
// attempting to sending 1 MsgVote every microsecond. See comments
// below and above for the frequency rationale.
if failedSendLog.ShouldLog() {
log.Infof(ctx, "transport failed to send vote request")
}
}
select {
case <-splitDone:
Expand Down