Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix flaky HTTPRoute creation #44

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions test/integration/test_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,31 +312,31 @@ func TestGatewayMultiple(t *testing.T) {
httpRouteOne := createHTTPRoute(gatewayOne, service, pathOne)
require.EventuallyWithT(t,
func(c *assert.CollectT) {
var err error
httpRouteOne, err = gatewayV1Client.HTTPRoutes(namespace.Name).Create(GetCtx(), httpRouteOne, metav1.CreateOptions{})
result, err := gatewayV1Client.HTTPRoutes(namespace.Name).Create(GetCtx(), httpRouteOne, metav1.CreateOptions{})
if err != nil {
t.Logf("failed to deploy httproute: %v", err)
c.Errorf("failed to deploy httproute: %v", err)
return
}
cleaner.Add(result)
},
30*time.Second, time.Second,
)
cleaner.Add(httpRouteOne)

const pathTwo = "/path-test-two"
httpRouteTwo := createHTTPRoute(gatewayTwo, service, pathTwo)
require.EventuallyWithT(t,
func(c *assert.CollectT) {
var err error
httpRouteTwo, err = gatewayV1Client.HTTPRoutes(namespace.Name).Create(GetCtx(), httpRouteTwo, metav1.CreateOptions{})
result, err := gatewayV1Client.HTTPRoutes(namespace.Name).Create(GetCtx(), httpRouteTwo, metav1.CreateOptions{})
if err != nil {
t.Logf("failed to deploy httproute: %v", err)
c.Errorf("failed to deploy httproute: %v", err)
return
}
cleaner.Add(result)
},
30*time.Second, time.Second,
)
cleaner.Add(httpRouteTwo)

t.Log("verifying connectivity to the HTTPRoute")

Expand Down
5 changes: 3 additions & 2 deletions test/integration/test_httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,16 @@ func TestHTTPRouteV1Beta1(t *testing.T) {
t.Logf("creating httproute %s/%s to access deployment %s via kong", httpRoute.Namespace, httpRoute.Name, deployment.Name)
require.EventuallyWithT(t,
func(c *assert.CollectT) {
httpRoute, err = GetClients().GatewayClient.GatewayV1().HTTPRoutes(namespace.Name).Create(GetCtx(), httpRoute, metav1.CreateOptions{})
result, err := GetClients().GatewayClient.GatewayV1().HTTPRoutes(namespace.Name).Create(GetCtx(), httpRoute, metav1.CreateOptions{})
if err != nil {
t.Logf("failed to deploy httproute: %v", err)
c.Errorf("failed to deploy httproute: %v", err)
return
}
cleaner.Add(result)
},
testutils.DefaultIngressWait, testutils.WaitIngressTick,
)
cleaner.Add(httpRoute)

t.Log("verifying connectivity to the HTTPRoute")
const (
Expand Down
Loading