Skip to content

Commit

Permalink
kv: deflake TestPriorityRatchetOnAbortOrPush
Browse files Browse the repository at this point in the history
Fixes #68584.

The test was flaky for the reasons described in #68584. There doesn't appear to
be an easy way to fix this behavior, and it's not clear how valuable doing so
even is given how little we rely on transaction priorities anymore, so the
commit just deflakes the test by rejecting them.

Release justification: deflaking a test.
  • Loading branch information
nvanbenschoten committed Sep 2, 2021
1 parent b0379ad commit aa71648
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/kv/kvclient/kvcoord/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,17 @@ func TestLostUpdate(t *testing.T) {
func TestPriorityRatchetOnAbortOrPush(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)
s := createTestDB(t)
s := createTestDBWithKnobs(t, &kvserver.StoreTestingKnobs{
TestingRequestFilter: func(_ context.Context, ba roachpb.BatchRequest) *roachpb.Error {
// Reject transaction heartbeats, which can make the test flaky when they
// detect an aborted transaction before the Get operation does. See #68584
// for an explanation.
if ba.IsSingleHeartbeatTxnRequest() {
return roachpb.NewErrorf("rejected")
}
return nil
},
})
defer s.Stop()

pushByReading := func(key roachpb.Key) {
Expand Down

0 comments on commit aa71648

Please sign in to comment.