1
0
Fork 0

Add passive health checks

This commit is contained in:
Nelson Isioma 2025-08-21 10:40:06 +01:00 committed by GitHub
parent c20802b07e
commit fc0fac8543
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 696 additions and 6 deletions

View file

@ -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 {