From e1f60cd3cf2cf39fb5cfdaaa10a95fca069ed2ad Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Wed, 19 Jun 2019 13:47:04 -0400 Subject: [PATCH] storage: fix flake in Test{Conditional,Init}PutUpdatesTSCacheOnError Fixes #38256. A request was slipping in between the manual clock update and the first request the test sent with an unspecified timestamp. This commit fixes the issue by explicitly specifying the timestamp. Release note: None --- pkg/storage/replica_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/storage/replica_test.go b/pkg/storage/replica_test.go index 8c83eabcd2ec..4e06d916d171 100644 --- a/pkg/storage/replica_test.go +++ b/pkg/storage/replica_test.go @@ -2807,7 +2807,7 @@ func TestConditionalPutUpdatesTSCacheOnError(t *testing.T) { // CPut args which expect value "1" to write "0". key := []byte("a") cpArgs1 := cPutArgs(key, []byte("1"), []byte("0")) - _, pErr := tc.SendWrapped(&cpArgs1) + _, pErr := tc.SendWrappedWith(roachpb.Header{Timestamp: t2}, &cpArgs1) if cfErr, ok := pErr.GetDetail().(*roachpb.ConditionFailedError); !ok { t.Errorf("expected ConditionFailedError; got %v", pErr) } else if cfErr.ActualValue != nil { @@ -2895,7 +2895,7 @@ func TestInitPutUpdatesTSCacheOnError(t *testing.T) { // InitPut args to write "1" to same key. Should fail. ipArgs2 := iPutArgs(key, []byte("1")) - _, pErr = tc.SendWrapped(&ipArgs2) + _, pErr = tc.SendWrappedWith(roachpb.Header{Timestamp: t2}, &ipArgs2) if cfErr, ok := pErr.GetDetail().(*roachpb.ConditionFailedError); !ok { t.Errorf("expected ConditionFailedError; got %v", pErr) } else if valueBytes, err := cfErr.ActualValue.GetBytes(); err != nil {