Skip to content
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
8 changes: 8 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,24 @@ jobs:
- version: v1.30.10
ipFamily: ipv4
profile: default
loadQPS: 1000
- version: v1.31.6
ipFamily: ipv4
profile: default
loadQPS: 2000
- version: v1.32.3
ipFamily: ipv6 # only run ipv6 test on this version to save time
profile: default
loadQPS: 3000
# TODO: this's IPv4 first, need a way to test IPv6 first.
- version: v1.33.0
ipFamily: dual # only run dual test on latest version to save time
profile: default
loadQPS: 4000
- version: v1.33.0
ipFamily: dual # only run dual test on latest version to save time
profile: gateway-namespace-mode
loadQPS: 5000
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./tools/github-actions/setup-deps
Expand All @@ -172,6 +177,9 @@ jobs:
IP_FAMILY: ${{ matrix.target.ipFamily }}
KUBE_DEPLOY_PROFILE: ${{ matrix.target.profile }}
E2E_TIMEOUT: 1h
# use the loadQPS from the matrix to set the QPS for the E2E tests
# this is used to determine whether the flaky tests are due to load or not
E2E_BACKEND_UPGRADE_QPS: ${{ matrix.target.loadQPS }}
NUM_WORKERS: 2
run: make e2e

Expand Down
12 changes: 6 additions & 6 deletions test/e2e/tests/backend_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"sigs.k8s.io/gateway-api/conformance/utils/http"
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
"sigs.k8s.io/gateway-api/conformance/utils/suite"
"sigs.k8s.io/gateway-api/conformance/utils/tlog"
)

func init() {
Expand Down Expand Up @@ -65,24 +66,23 @@ var BackendUpgradeTest = suite.ConformanceTest{
// will contain indication on success or failure of load test
loadSuccess := make(chan bool)

t.Log("Starting load generation")
tlog.Logf(t, "Starting load generation")
// Run load async and continue to restart deployment
go runLoadAndWait(t, suite.TimeoutConfig, loadSuccess, aborter, reqURL.String())

t.Log("Restarting deployment")
tlog.Logf(t, "Restarting deployment")
err = restartDeploymentAndWaitForNewPods(t, suite.TimeoutConfig, suite.Client, dp)

t.Log("Stopping load generation and collecting results")
tlog.Logf(t, "Stopping load generation and collecting results")
aborter.Abort(false) // abort the load either way

if err != nil {
t.Errorf("Failed to restart deployment")
tlog.Errorf(t, "Failed to restart deployment")
}

// Wait for the goroutine to finish
result := <-loadSuccess
if !result {
t.Errorf("Load test failed")
tlog.Errorf(t, "Load test failed")
}
})
},
Expand Down
12 changes: 11 additions & 1 deletion test/e2e/tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,20 @@ func AlmostEquals(actual, expect, offset int) bool {
// the done channel is used to notify caller of execution result
// the execution may end due to an external abort or timeout
func runLoadAndWait(t *testing.T, timeoutConfig config.TimeoutConfig, done chan bool, aborter *periodic.Aborter, reqURL string) {
qpsVal := os.Getenv("E2E_BACKEND_UPGRADE_QPS")
qps := 5000
if qpsVal != "" {
if v, err := strconv.Atoi(qpsVal); err == nil {
qps = v
} else {
tlog.Logf(t, "Invalid QPS value %s, using default %d", qpsVal, qps)
}
}

flog.SetLogLevel(flog.Error)
opts := fhttp.HTTPRunnerOptions{
RunnerOptions: periodic.RunnerOptions{
QPS: 5000,
QPS: float64(qps),
// allow some overhead time for setting up workers and tearing down after restart
Duration: timeoutConfig.CreateTimeout + timeoutConfig.CreateTimeout/2,
NumThreads: 50,
Expand Down