Skip to content

test: Parallelize the End to End tests - Part two enablement#2033

Merged
elevran merged 27 commits into
llm-d:mainfrom
shmuelk:e2e-parallel-2
Jul 21, 2026
Merged

test: Parallelize the End to End tests - Part two enablement#2033
elevran merged 27 commits into
llm-d:mainfrom
shmuelk:e2e-parallel-2

Conversation

@shmuelk

@shmuelk shmuelk commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind test

What this PR does / why we need it:
Currently the llm-d-router End to End tests run for quite a long time (about sixteen minutes on my Mac M4 Max).

This long time has affected the CI pipeline in the past. A work around was done to run the tests in parts in parallel in separate Kind clusters. This splitting up of the tests needs to be managed manually and has overhead as prepetory steps are done over and over again for each test "slice'

A better solution is to run tests in parallel on the same Kind cluster using K8S Namespaces for separation as needed.

This PR enables the End to End tests to run in parallel. The tests are broken up into groups, mostly by Ginkgo When blocks. By default five such groups run in parallel, all on the same Kind cluster, each using its own namespace with an envoy instance and its own nodePort.

On my laptop a Mac M4 (Max) this PR has reduced the time to run the tests from about sixteen minutes, to between five and six minutes, a significant improvement.

A future PR will update CI to exploit this PR and remove the "test labels"

Which issue(s) this PR fixes:
Refs #1931

Release note (write NONE if no user-facing change):

NONE

@shmuelk
shmuelk requested a review from a team as a code owner July 15, 2026 14:45
@shmuelk
shmuelk requested review from elevran and vMaroon July 15, 2026 14:45
@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 15, 2026
@github-actions github-actions Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 16, 2026
shmuelk added 21 commits July 19, 2026 13:59
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
shmuelk added 2 commits July 19, 2026 14:39
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
@elevran elevran self-assigned this Jul 20, 2026
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
@elevran

elevran commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

lint not passing

@elevran elevran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parallelizing the e2e suite via Ginkgo's multi-process runner is a good direction and the 10m saving is significant - thanks!

Two things need attention before merge:

  1. CI lint is currently failing (staticcheck QF1001 in setup_test.go) - see inline comment.
  2. The new NodePort computation ignores any overrides in E2E_PORT/E2E_METRICS_PORT and would no longer match the actual NodePort of the created Service.

Comment thread test/e2e/setup_test.go Outdated

ginkgo.AfterAll(func() {
// Only cleanup if the test succeeded
if !(ginkgo.CurrentSpecReport().Failed() && keepClusterOnFailure) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI lint fails

Suggested change
if !(ginkgo.CurrentSpecReport().Failed() && keepClusterOnFailure) {
if !ginkgo.CurrentSpecReport().Failed() || !keepClusterOnFailure {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed,

Comment thread test/e2e/setup_test.go Outdated

infraSubs := map[string]string{
"${EPP_NAME}": "e2e-epp",
"${METRICS_NODE_PORT}": strconv.Itoa(32090 + 100*(ginkgo.GinkgoParallelProcess()-1)),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hardcodes 32090 instead of using baseMetricsPort, diverging from getMetricsPort() (via testutils.ProcessPort(baseMetricsPort)) used elsewhere in this file.
If a user overrides E2E_METRICS_PORT, the client dials the overridden port but the NodePort Service created here still binds to 32090-based values.

Comment thread test/e2e/e2e_suite_test.go Outdated
func createEnvoy(nsName string) ([]string, *gexec.Session) {
infraSubs := map[string]string{
"${NAMESPACE}": nsName,
"${ENVOY_NODE_PORT}": strconv.Itoa(30080 + 100*(ginkgo.GinkgoParallelProcess()-1)),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the metrics port: this hardcodes 30080 instead of basePort.
Overriding E2E_PORT would break the NodePort/client-port match.

Comment thread test/e2e/setup_test.go Outdated

// testWrapper wraps tests with the setup and teardown code needed.
// It is used as a wrapper of the function passed to ginkgo.When calls that
// setup the tests. It is important that the gink.Ordered decorator is used

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// setup the tests. It is important that the gink.Ordered decorator is used
// setup the tests. It is important that the ginkgo.Ordered decorator is used

Comment thread test/scripts/e2e-common.sh Outdated
E2E_NUM_PROCS=1 go test -v -timeout 45m "${pkg}" -ginkgo.v -ginkgo.fail-fast "-ginkgo.label-filter=${E2E_LABEL_FILTER}"
else
go test -v -timeout 45m "${pkg}" -ginkgo.v -ginkgo.fail-fast
ginkgo run --procs=${E2E_NUM_PROCS} --timeout 45m -v --fail-fast "${pkg}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
${E2E_NUM_PROCS} is unquoted here, unlike the other variable expansions in this function (e.g., "${pkg}", "${E2E_LABEL_FILTER}"). Low risk but worth being consistent.

shmuelk added 3 commits July 21, 2026 09:10
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
@shmuelk

shmuelk commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@elevran Thanks for the thorough review. I believe all of theissues raised have been fixed.

@elevran
elevran merged commit feafdf4 into llm-d:main Jul 21, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants