From 9536ec490466492b90562ab5edcd66b9f490b457 Mon Sep 17 00:00:00 2001 From: haopeng <63844184+lhpqaq@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:07:42 +0800 Subject: [PATCH] fix(test): modify the comparison to function signatures in TestClientOptions (#1163) --- pkg/app/client/option_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/app/client/option_test.go b/pkg/app/client/option_test.go index 3b5af7183..08e6c851d 100644 --- a/pkg/app/client/option_test.go +++ b/pkg/app/client/option_test.go @@ -40,7 +40,7 @@ func TestClientOptions(t *testing.T) { retry.WithInitDelay(100*time.Millisecond), retry.WithMaxDelay(5*time.Second), retry.WithMaxJitter(1*time.Second), - retry.WithDelayPolicy(retry.CombineDelay(retry.FixedDelayPolicy, retry.BackOffDelayPolicy, retry.RandomDelayPolicy)), + retry.WithDelayPolicy(retry.CombineDelay(retry.DefaultDelayPolicy, retry.FixedDelayPolicy, retry.BackOffDelayPolicy)), ), WithWriteTimeout(time.Second), WithConnStateObserve(nil, time.Second), @@ -59,4 +59,7 @@ func TestClientOptions(t *testing.T) { assert.DeepEqual(t, 5*time.Second, opt.RetryConfig.MaxDelay) assert.DeepEqual(t, 1*time.Second, opt.RetryConfig.MaxJitter) assert.DeepEqual(t, 1*time.Second, opt.ObservationInterval) + for i := 0; i < 100; i++ { + assert.DeepEqual(t, opt.RetryConfig.DelayPolicy(uint(i), nil, opt.RetryConfig), retry.CombineDelay(retry.DefaultDelayPolicy, retry.FixedDelayPolicy, retry.BackOffDelayPolicy)(uint(i), nil, opt.RetryConfig)) + } }