Skip to content

feat: implemented e2e test for router config-update #921

Merged
volcano-sh-bot merged 7 commits intovolcano-sh:mainfrom
katara-Jayprakash:e2e-test-for-router-config
May 9, 2026
Merged

feat: implemented e2e test for router config-update #921
volcano-sh-bot merged 7 commits intovolcano-sh:mainfrom
katara-Jayprakash:e2e-test-for-router-config

Conversation

@katara-Jayprakash
Copy link
Copy Markdown
Member

@katara-Jayprakash katara-Jayprakash commented Apr 24, 2026

Description:
Adds an E2E test that verifies updating the router's ConfigMap and restarting the pods picks up the new configuration.

What the test does:

  • Sends a request with the default config to confirm routing works
  • Updates the router ConfigMap to use only least-request as the score plugin (removes gpu-usage, least-latency, prefix-cache) and bumps maxWaitingRequests to 100
  • Deletes router pods and waits for fresh ones to come up
  • Checks scheduler plugin metrics to verify only the configured plugins are active
  • Sends another request to confirm routing still works after restart
  • Cleans up by restoring the original ConfigMap and restarting pods

Fix: #853

Copilot AI review requested due to automatic review settings April 24, 2026 15:49
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces end-to-end tests to verify that updating the router's configuration via a ConfigMap and restarting the deployment correctly applies the new settings. The tests cover both standard and Gateway API scenarios, validating routing functionality and scheduler plugin metrics after the update. Feedback includes simplifying label selector construction using standard library functions, addressing a potential resource leak with unclosed port-forwards in cleanup blocks, and ensuring ConfigMap updates use fresh objects to avoid concurrency conflicts.

Comment thread test/e2e/router/shared.go Outdated
Comment thread test/e2e/router/shared.go Outdated
Comment thread test/e2e/router/shared.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an end-to-end test that validates router ConfigMap updates take effect after restarting the router, shared across the “router” and “gateway-api” e2e suites.

Changes:

  • Introduces TestRouterConfigUpdateShared to update the router ConfigMap, restart router pods, and verify behavior + metrics.
  • Adds suite-specific wrapper tests in both router and gateway-api packages to run the shared test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
test/e2e/router/shared.go Adds shared e2e test logic for updating router config, restarting pods, and validating metrics.
test/e2e/router/gateway-api/e2e_test.go Adds a Gateway API wrapper test calling the shared test helper.
test/e2e/router/e2e_test.go Adds a non-Gateway API wrapper test calling the shared test helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/e2e/router/shared.go
Comment thread test/e2e/router/shared.go Outdated
Comment thread test/e2e/router/shared.go Outdated
Comment thread test/e2e/router/shared.go
@katara-Jayprakash
Copy link
Copy Markdown
Member Author

/cc @LiZhenCheng9527 @YaoZengzeng @hzxuzhonghu @FAUST-BENCHOU e2e are passing! feel free to review this!

@hzxuzhonghu
Copy link
Copy Markdown
Member

/assign @YaoZengzeng

Comment thread test/e2e/router/shared.go Outdated
@YaoZengzeng
Copy link
Copy Markdown
Member

This test should also be added to https://github.com/volcano-sh/kthena/blob/main/test/e2e/router/gateway-inference-extension/e2e_test.go

Copilot AI review requested due to automatic review settings May 9, 2026 03:31
@katara-Jayprakash katara-Jayprakash force-pushed the e2e-test-for-router-config branch from f9d6c19 to 9b90e91 Compare May 9, 2026 03:33
Comment thread test/e2e/router/shared.go

// Register cleanup to restore original ConfigMap, restart router, and
// re-establish port-forward for subsequent tests.
t.Cleanup(func() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i actually removed port-forward from cleanup to avoid the resource leak. The test now uses its own dynamic port with defer pf.Close(), just like TestHTTPRouteNotSkippedAfterRouterRestart test

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread test/e2e/router/shared.go
Comment on lines +1754 to +1766
defer pf.Close()

restartedRouterURL := fmt.Sprintf("http://127.0.0.1:%s/v1/chat/completions", restartedRouterPort)
restartedMetricsURL := fmt.Sprintf("http://127.0.0.1:%s/metrics", restartedRouterPort)

// Verify routing works after config update and restart.
t.Run("VerifyUpdatedConfig", func(t *testing.T) {
resp := utils.CheckChatCompletionsWithURL(t, restartedRouterURL, modelRoute.Spec.ModelName, messages)
assert.Equal(t, 200, resp.StatusCode, "Routing should work after config update and restart")
})

// Verify the updated config took effect by checking scheduler plugin metrics.
// After restart, only the configured score plugins should appear in metrics.
Comment thread test/e2e/router/shared.go Outdated
Comment on lines +1712 to +1716
preRestartPods := getRouterPods(t, testCtx.KubeClient, kthenaNamespace)
preRestartPodNames := make(map[string]bool, len(preRestartPods))
for _, pod := range preRestartPods {
preRestartPodNames[pod.Name] = true
}
@katara-Jayprakash katara-Jayprakash force-pushed the e2e-test-for-router-config branch from 9b90e91 to f9d6c19 Compare May 9, 2026 03:47
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
Copilot AI review requested due to automatic review settings May 9, 2026 04:49
@katara-Jayprakash katara-Jayprakash force-pushed the e2e-test-for-router-config branch from f9d6c19 to 0bd609a Compare May 9, 2026 04:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread test/e2e/router/shared.go
Comment thread test/e2e/router/e2e_test.go
Comment thread test/e2e/router/gateway-api/e2e_test.go
Comment thread test/e2e/router/shared.go
Signed-off-by: katara-Jayprakash <katarajayprakash@icloud.com>
@katara-Jayprakash
Copy link
Copy Markdown
Member Author

/cc @YaoZengzeng @hzxuzhonghu @LiZhenCheng9527 test are passing and everything is fixed now can we merge it now!

@YaoZengzeng
Copy link
Copy Markdown
Member

/lgtm
/approve

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: YaoZengzeng

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot merged commit f5927c1 into volcano-sh:main May 9, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E test for router config update

5 participants