Skip to content

Commit 71720c3

Browse files
committed
kvcoord: add logging in TestWaiterOnRejectedCommit
This should help debugging/deflaking this test should it fail again. The conjecture is that we end up with more than one command ID, and only one gets the injected error, while another one succeeds. Epic: none Release note: none
1 parent 79e136a commit 71720c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/kv/kvclient/kvcoord/integration_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func TestWaiterOnRejectedCommit(t *testing.T) {
8585
if !ba.Txn.ID.Equal(v.(uuid.UUID)) {
8686
return nil
8787
}
88+
t.Logf("EndTxn command ID: %v", args.CmdID)
8889
commitCmdID.Store(args.CmdID)
8990
return nil
9091
},
@@ -99,10 +100,12 @@ func TestWaiterOnRejectedCommit(t *testing.T) {
99100
if args.CmdID == cmdID {
100101
if illegalLeaseIndex {
101102
illegalLeaseIndex = false
102-
// NB: 1 is proposalIllegalLeaseIndex.
103+
t.Logf("injecting illegal lease index for %v", cmdID)
104+
// NB: 1 is ProposalRejectionIllegalLeaseIndex.
103105
return 1, kvpb.NewErrorf("test injected err (illegal lease index)")
104106
}
105-
// NB: 0 is proposalNoReevaluation.
107+
t.Logf("injecting permanent rejection for %v", cmdID)
108+
// NB: 0 is ProposalRejectionPermanent.
106109
return 0, kvpb.NewErrorf("test injected err")
107110
}
108111
return 0, nil
@@ -162,6 +165,7 @@ func TestWaiterOnRejectedCommit(t *testing.T) {
162165
t.Fatal(err)
163166
}
164167
}
168+
t.Logf("txn ID: %v", txn.ID())
165169
txnID.Store(txn.ID())
166170

167171
readerDone := make(chan error, 2)

0 commit comments

Comments
 (0)