Skip to content

Commit

Permalink
Always run the high-concurrency tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sengi committed Jul 28, 2023
1 parent ab151d2 commit 64d3d7c
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions integration_tests/performance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package integration

import (
"net/http/httptest"
"os"
"time"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -85,42 +84,34 @@ var _ = Describe("Performance", func() {
})
})

if os.Getenv("RUN_ULIMIT_DEPENDENT_TESTS") != "" {
Describe("high request throughput", func() {
It("should not significantly increase latency", func() {
assertPerformantRouter(backend1, backend2, 3000)
})
Describe("high request throughput", func() {
It("should not significantly increase latency", func() {
assertPerformantRouter(backend1, backend2, 3000)
})
}
})
})

Describe("many concurrent (slow) connections", func() {
if os.Getenv("RUN_ULIMIT_DEPENDENT_TESTS") != "" {
var (
backend1 *httptest.Server
backend2 *httptest.Server
)

BeforeEach(func() {
backend1 = startTarpitBackend(time.Second)
backend2 = startTarpitBackend(time.Second)
addBackend("backend-1", backend1.URL)
addBackend("backend-2", backend2.URL)
addRoute("/one", NewBackendRoute("backend-1"))
addRoute("/two", NewBackendRoute("backend-2"))
reloadRoutes()
})
AfterEach(func() {
backend1.Close()
backend2.Close()
})
Describe("many concurrent slow connections", func() {
var backend1 *httptest.Server
var backend2 *httptest.Server

It("should not significantly increase latency", func() {
assertPerformantRouter(backend1, backend2, 1000)
})
} else {
PIt("high throughput requires elevated ulimit")
}
BeforeEach(func() {
backend1 = startTarpitBackend(time.Second)
backend2 = startTarpitBackend(time.Second)
addBackend("backend-1", backend1.URL)
addBackend("backend-2", backend2.URL)
addRoute("/one", NewBackendRoute("backend-1"))
addRoute("/two", NewBackendRoute("backend-2"))
reloadRoutes()
})
AfterEach(func() {
backend1.Close()
backend2.Close()
})

It("should not significantly increase latency", func() {
assertPerformantRouter(backend1, backend2, 1000)
})
})
})

Expand Down

0 comments on commit 64d3d7c

Please sign in to comment.