Skip to content

Commit

Permalink
storage: manually increment clock in TestTxnRecordLifecycleTransitions
Browse files Browse the repository at this point in the history
This ensures that we're not accidentally relying on the fact that `runTs`
was usually one logical tick above `txn.Timestamp`. This has caused
flakiness in the past (see previous commit).

With this change, the flake fixed in the previous commit fails reliably.

Release note: None
  • Loading branch information
nvanbenschoten committed Sep 9, 2019
1 parent b943d81 commit fac112b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/storage/replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11512,7 +11512,9 @@ func TestTxnRecordLifecycleTransitions(t *testing.T) {
defer setTxnAutoGC(!c.disableTxnAutoGC)()

txn := newTransaction(c.name, roachpb.Key(c.name), 1, tc.Clock())
manual.Increment(99)
runTs := tc.Clock().Now()

if c.setup != nil {
if err := c.setup(txn, runTs); err != nil {
t.Fatalf("failed during test setup: %+v", err)
Expand Down

0 comments on commit fac112b

Please sign in to comment.