Skip to content

Commit

Permalink
e2e: fix some tests (#4729)
Browse files Browse the repository at this point in the history
* e2e: make timeout configurable

Signed-off-by: zirain <zirain2009@gmail.com>

* skip upgrade tests

Signed-off-by: zirain <zirain2009@gmail.com>

* timeout

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain authored Nov 19, 2024
1 parent b7bd5ad commit 8a01dd6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/e2e/tests/envoy_shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ func restartProxyAndWaitForRollout(t *testing.T, timeoutConfig config.TimeoutCon
return err
}

return wait.PollUntilContextTimeout(ctx, 1*time.Second, timeoutConfig.CreateTimeout, true, func(ctx context.Context) (bool, error) {
// increase timeout for IPv6 first cluster
return wait.PollUntilContextTimeout(ctx, 2*time.Second, 2*timeoutConfig.CreateTimeout, true, func(ctx context.Context) (bool, error) {
// wait for replicaset with the same annotation to reach ready status
podList := &corev1.PodList{}
listOpts := []client.ListOption{
Expand Down
10 changes: 9 additions & 1 deletion test/e2e/upgrade/eg_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ func TestEGUpgrade(t *testing.T) {
*flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug)
}

var skipTests []string
// previous did not support ipv6, so skip upgrade tests for ipv6
if tests.IPFamily == "ipv6" {
skipTests = append(skipTests,
tests.EGUpgradeTest.ShortName,
)
}

cSuite, err := suite.NewConformanceTestSuite(suite.ConformanceOptions{
Client: c,
RestConfig: cfg,
Expand All @@ -46,7 +54,7 @@ func TestEGUpgrade(t *testing.T) {
RunTest: *flags.RunTest,
BaseManifests: "upgrade/manifests.yaml",
SupportedFeatures: sets.New[features.FeatureName](features.SupportGateway),
SkipTests: []string{},
SkipTests: skipTests,
})
if err != nil {
t.Fatalf("Failed to create test suite: %v", err)
Expand Down
3 changes: 2 additions & 1 deletion test/utils/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package prometheus
import (
"context"
"fmt"
"net"
"time"

prom "github.com/prometheus/client_golang/api"
Expand Down Expand Up @@ -36,7 +37,7 @@ func NewClient(kubeClient client.Client, nn types.NamespacedName) (*Client, erro
var addr string
for _, ing := range svc.Status.LoadBalancer.Ingress {
if len(ing.IP) > 0 {
addr = fmt.Sprintf("http://%s", ing.IP)
addr = fmt.Sprintf("http://%s", net.JoinHostPort(ing.IP, "80"))
}
}

Expand Down
3 changes: 2 additions & 1 deletion tools/make/kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ BENCHMARK_REPORT_DIR ?= benchmark_report

E2E_RUN_TEST ?=
E2E_CLEANUP ?= true
E2E_TEST_ARGS ?= -v -tags e2e -timeout 20m
E2E_TIMEOUT ?= 20m
E2E_TEST_ARGS ?= -v -tags e2e -timeout $(E2E_TIMEOUT)

# Set Kubernetes Resources Directory Path
ifeq ($(origin KUBE_PROVIDER_DIR),undefined)
Expand Down

0 comments on commit 8a01dd6

Please sign in to comment.