Skip to content

Commit

Permalink
Fix scale test errors caused by upstream server count (#2439)
Browse files Browse the repository at this point in the history
Problem: When the scale test runs with NGINX Plus with 648 upstream servers, it reports both NGF and NGINX Plus errors, because at some point the upstream zone size is no longer enough to hold all upstream servers. As a result, NGF fails to update NGINX Plus.

Solution: Adjust the upstream server count on the scale test when it runs with NGINX Plus from 648 to 556.

Testing: Scale test passed 5 consecutive times.
  • Loading branch information
bjee19 authored Aug 23, 2024
1 parent 1a9cea0 commit 6136715
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tests/suite/scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ var _ = Describe("Scale test", Ordered, Label("nfr", "scale"), func() {
ngfPodName string
promInstance framework.PrometheusInstance
promPortForwardStopCh = make(chan struct{})

upstreamServerCount int32
)

const (
httpListenerCount = 64
httpsListenerCount = 64
httpRouteCount = 1000
upstreamServerCount = 648
httpListenerCount = 64
httpsListenerCount = 64
httpRouteCount = 1000
ossUpstreamServerCount = 648
plusUpstreamServerCount = 556
)

BeforeAll(func() {
Expand Down Expand Up @@ -85,6 +88,12 @@ var _ = Describe("Scale test", Ordered, Label("nfr", "scale"), func() {
if !clusterInfo.IsGKE {
Expect(promInstance.PortForward(k8sConfig, promPortForwardStopCh)).To(Succeed())
}

if *plusEnabled {
upstreamServerCount = plusUpstreamServerCount
} else {
upstreamServerCount = ossUpstreamServerCount
}
})

BeforeEach(func() {
Expand Down Expand Up @@ -563,7 +572,10 @@ The logs are attached only if there are errors.
)
})

It(fmt.Sprintf("scales upstream servers to %d", upstreamServerCount), func() {
It(fmt.Sprintf("scales upstream servers to %d for OSS and %d for Plus",
ossUpstreamServerCount,
plusUpstreamServerCount,
), func() {
const testName = "TestScale_UpstreamServers"

testResultsDir := filepath.Join(resultsDir, testName)
Expand Down

0 comments on commit 6136715

Please sign in to comment.