Skip to content

Commit

Permalink
*: use revision for watch test (#6205)
Browse files Browse the repository at this point in the history
ref #6071

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
rleungx and ti-chi-bot authored Mar 22, 2023
1 parent 27b9474 commit fb56ce5
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/tso/tso.go
Original file line number Diff line number Diff line change
@@ -198,7 +198,7 @@ func (t *timestampOracle) isInitialized() bool {

// resetUserTimestamp update the TSO in memory with specified TSO by an atomically way.
// When ignoreSmaller is true, resetUserTimestamp will ignore the smaller tso resetting error and do nothing.
// It's used to write MaxTS during the Global TSO synchronization whitout failing the writing as much as possible.
// It's used to write MaxTS during the Global TSO synchronization without failing the writing as much as possible.
// cannot set timestamp to one which >= current + maxResetTSGap
func (t *timestampOracle) resetUserTimestamp(leadership *election.Leadership, tso uint64, ignoreSmaller bool) error {
return t.resetUserTimestampInner(leadership, tso, ignoreSmaller, false)
5 changes: 4 additions & 1 deletion tests/client/client_test.go
Original file line number Diff line number Diff line change
@@ -1358,7 +1358,10 @@ func TestWatch(t *testing.T) {
defer client.Close()

key := "test"
ch, err := client.Watch(ctx, []byte(key))
resp, err := client.Get(ctx, []byte(key))
re.NoError(err)
rev := resp.GetHeader().GetRevision()
ch, err := client.Watch(ctx, []byte(key), pd.WithRev(rev))
re.NoError(err)
exit := make(chan struct{})
go func() {

0 comments on commit fb56ce5

Please sign in to comment.