Skip to content

Commit

Permalink
extend timeout period for lockservice ut (#19412)
Browse files Browse the repository at this point in the history
extend timeout period for lockservice ut

Approved by: @zhangxu19830126
  • Loading branch information
iamlinjunhong authored Oct 18, 2024
1 parent 13e946c commit a32e015
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/lockservice/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func TestMOErrorCanHandled(t *testing.T) {
writeResponse(ctx, getLogger(""), cancel, resp, moerr.NewDeadLockDetectedNoCtx(), cs)
})

ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
resp, err := c.Send(ctx, &lock.Request{
LockTable: lock.LockTable{ServiceID: "s1"},
Expand Down Expand Up @@ -315,7 +315,7 @@ func TestLockTableBindChanged(t *testing.T) {
writeResponse(ctx, getLogger(""), cancel, resp, nil, cs)
})

ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
resp, err := c.Send(ctx, &lock.Request{
LockTable: lock.LockTable{ServiceID: "s1"},
Expand Down
4 changes: 2 additions & 2 deletions pkg/lockservice/service_remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ func runBindChangedTests(
fn(ctx, alloc, l1, l2, table1)
},
func(c *Config) {
c.KeepBindDuration.Duration = time.Millisecond * 50
c.KeepRemoteLockDuration.Duration = time.Millisecond * 50
c.KeepBindDuration.Duration = time.Second
c.KeepRemoteLockDuration.Duration = time.Second

c.RPC.BackendOptions = append(c.RPC.BackendOptions,
morpc.WithBackendFilter(func(m morpc.Message, s string) bool {
Expand Down
4 changes: 2 additions & 2 deletions pkg/lockservice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ func TestIssue16121(t *testing.T) {
t,
zapcore.DebugLevel,
[]string{"s1", "s2"},
time.Second*1,
time.Second*10,
func(alloc *lockTableAllocator, s []*service) {
l1 := s[0]
l2 := s[1]
Expand Down Expand Up @@ -2120,7 +2120,7 @@ func TestReLockSuccWithBindChanged(t *testing.T) {
t,
zapcore.DebugLevel,
[]string{"s1", "s2"},
time.Second*1,
time.Second*10,
func(alloc *lockTableAllocator, s []*service) {
l1 := s[0]
l2 := s[1]
Expand Down

0 comments on commit a32e015

Please sign in to comment.