Add passive health checks
This commit is contained in:
parent
c20802b07e
commit
fc0fac8543
20 changed files with 696 additions and 6 deletions
|
|
@ -10,9 +10,11 @@ import (
|
|||
"net/textproto"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
ptypes "github.com/traefik/paerser/types"
|
||||
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v3/pkg/config/runtime"
|
||||
"github.com/traefik/traefik/v3/pkg/proxy/httputil"
|
||||
|
|
@ -67,6 +69,19 @@ func TestGetLoadBalancer(t *testing.T) {
|
|||
fwd: &forwarderMock{},
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
desc: "Succeeds when passive health checker is set",
|
||||
serviceName: "test",
|
||||
service: &dynamic.ServersLoadBalancer{
|
||||
Strategy: dynamic.BalancerStrategyWRR,
|
||||
PassiveHealthCheck: &dynamic.PassiveServerHealthCheck{
|
||||
FailureWindow: ptypes.Duration(30 * time.Second),
|
||||
MaxFailedAttempts: 3,
|
||||
},
|
||||
},
|
||||
fwd: &forwarderMock{},
|
||||
expectError: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testCases {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue