Skip to content

Commit

Permalink
change interval
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Mar 19, 2024
1 parent 2fac014 commit bbb2470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/utils/etcdutil/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func EtcdKVGet(c *clientv3.Client, key string, opts ...clientv3.OpOption) (*clie
func IsHealthy(ctx context.Context, client *clientv3.Client) bool {
timeout := DefaultRequestTimeout
failpoint.Inject("fastTick", func() {
timeout = 10 * time.Millisecond
timeout = 20 * time.Millisecond
})
ctx, cancel := context.WithTimeout(clientv3.WithRequireLeader(ctx), timeout)
defer cancel()
Expand Down Expand Up @@ -265,7 +265,7 @@ func CreateEtcdClient(tlsConfig *tls.Config, acURLs []url.URL, sourceOpt ...stri

tickerInterval := defaultDialKeepAliveTime
failpoint.Inject("fastTick", func() {
tickerInterval = 10 * time.Millisecond
tickerInterval = 20 * time.Millisecond
})
failpoint.Inject("closeTick", func() {
failpoint.Return(client, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/etcdutil/etcdutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ func (suite *loopWatcherTestSuite) TestWatcherBreak() {
func([]*clientv3.Event) error { return nil },
false, /* withPrefix */
)
watcher.watchChangeRetryInterval = 100 * time.Millisecond
watcher.watchChangeRetryInterval = 20 * time.Millisecond
watcher.StartWatchLoop()
err := watcher.WaitLoad()
re.NoError(err)
Expand Down

0 comments on commit bbb2470

Please sign in to comment.