Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions internal/mode/static/state/graph/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1751,8 +1751,34 @@ func TestIsNGFPolicyRelevantPanics(t *testing.T) {
func TestGatewayExists(t *testing.T) {
t.Parallel()
g := NewWithT(t)
gwNsName := types.NamespacedName{Namespace: "test", Name: "gw"}

result := gatewayExists(gwNsName, nil)
g.Expect(result).To(BeFalse())
tests := []struct {
gateways map[types.NamespacedName]*Gateway
gwNsName types.NamespacedName
name string
expectedResult bool
}{
{
name: "gateway exists",
gwNsName: types.NamespacedName{Namespace: "test", Name: "gw"},
gateways: map[types.NamespacedName]*Gateway{
{Namespace: "test", Name: "gw"}: {},
{Namespace: "test", Name: "gw2"}: {},
},
expectedResult: true,
},
{
name: "gateway does not exist",
gwNsName: types.NamespacedName{Namespace: "test", Name: "gw"},
gateways: nil,
expectedResult: false,
},
}

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
g.Expect(gatewayExists(test.gwNsName, test.gateways)).To(Equal(test.expectedResult))
})
}
}
9 changes: 9 additions & 0 deletions internal/mode/static/state/graph/route_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3677,3 +3677,12 @@ func TestRemoveHostnames(t *testing.T) {
})
}
}

func TestBindRoutesToListeners(t *testing.T) {
t.Parallel()
g := NewWithT(t)

g.Expect(func() {
bindRoutesToListeners(nil, nil, nil, nil)
}).ToNot(Panic())
}
4 changes: 2 additions & 2 deletions tests/suite/graceful_recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
}

getLeaderElectionLeaseHolderName := func() (string, error) {
ctx, cancel := context.WithTimeout(context.Background(), timeoutConfig.GetTimeout)
ctx, cancel := context.WithTimeout(context.Background(), timeoutConfig.GetStatusTimeout)
defer cancel()

var lease coordination.Lease
Expand Down Expand Up @@ -384,7 +384,7 @@
}

BeforeAll(func() {
podNames, err := framework.GetReadyNGFPodNames(k8sClient, ngfNamespace, releaseName, timeoutConfig.GetTimeout)
podNames, err := framework.GetReadyNGFPodNames(k8sClient, ngfNamespace, releaseName, timeoutConfig.GetStatusTimeout)
Expect(err).ToNot(HaveOccurred())
Expect(podNames).To(HaveLen(1))

Expand Down Expand Up @@ -512,7 +512,7 @@

It("recovers when node is restarted abruptly", func() {
if *plusEnabled {
Skip(fmt.Sprintf("Skipping test when using NGINX Plus due to known issue:" +

Check notice on line 515 in tests/suite/graceful_recovery_test.go

View workflow job for this annotation

GitHub Actions / Functional tests (plus, v1.25.16) / Run Tests

It 04/18/25 18:10:11.324

Check notice on line 515 in tests/suite/graceful_recovery_test.go

View workflow job for this annotation

GitHub Actions / Functional tests (plus, v1.32.2) / Run Tests

It 04/18/25 18:10:30.446
" https://github.com/nginx/nginx-gateway-fabric/issues/3248"))
}
runRestartNodeAbruptlyTest(teaURL, coffeeURL, files, &ns)
Expand Down
Loading