Skip to content

Commit

Permalink
ttl: fix unstable test 'TestTTLTimerHookOnEvent' (#45446)
Browse files Browse the repository at this point in the history
close #45445
  • Loading branch information
lcwangchao authored Jul 19, 2023
1 parent 31bca92 commit 2bdc3e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ttl/ttlworker/timer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,11 @@ func TestWaitTTLJobFinish(t *testing.T) {
Times(10)
adapter.On("GetJob", hook.ctx, data.TableID, data.PhysicalID, timer.EventID).
Return(nil, errors.New("mockErr")).
Once().
Run(func(_ mock.Arguments) { hook.cancel() })
hook.wg.Add(1)
start := time.Now()
hook.waitJobFinished(logutil.BgLogger(), data, timer.ID, eventID, eventStart)
require.Less(t, time.Since(start), 10*time.Second)
adapter.AssertExpectations(t)
checkTTLTimerNotChange(t, cli, timer)
}
Expand Down

0 comments on commit 2bdc3e5

Please sign in to comment.