Alanxtl commented on code in PR #3180:
URL: https://github.com/apache/dubbo-go/pull/3180#discussion_r2724932610
##########
cluster/cluster/failback/cluster_test.go:
##########
@@ -147,14 +149,11 @@ func TestFailbackRetryFailed(t *testing.T) {
var wg sync.WaitGroup
retries := 2
wg.Add(retries)
- now := time.Now()
// add retry call that eventually failed.
for i := 0; i < retries; i++ {
- j := i + 1
invoker.EXPECT().Invoke(gomock.Any(),
gomock.Any()).DoAndReturn(func(context.Context, base.Invocation) result.Result {
- delta := time.Since(now).Nanoseconds() /
int64(time.Second)
- assert.GreaterOrEqual(t, delta, int64(5*j))
+ // with exponential backoff, retries happen with
increasing intervals starting from ~1s
wg.Done()
Review Comment:
这里指数退避也可以assert时间间隔吧
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]