-
Notifications
You must be signed in to change notification settings - Fork 212
test/integration: introduce robust harness and migrate EPP suite #2022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
test/integration: introduce robust harness and migrate EPP suite #2022
Conversation
|
@LukeAVanDrie: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @LukeAVanDrie. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/assign @ahg-g I included a test mapping in the PR description which should hopefully make reviewing |
|
/ok-to-test |
06fd22f to
5177995
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LukeAVanDrie The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Fixed the boilerplate issue on last push. |
Refactor the integration test utilities to provide a standardized way to start hermetic gRPC servers, and migrate the BBR harness to use it. - Add `StartExtProcServer`: A helper for background server management with strict TCP readiness checks and 127.0.0.1 binding. - Update `GetFreePort`: Return `int` instead of `*net.TCPAddr` for easier consumption. - Refactor `BBRHarness`: Remove manual server startup boilerplate in favor of the new shared helper, reducing code duplication.
Add a new testing infrastructure for the Endpoint Picker (EPP) to enable hermetic, namespace-isolated testing. - Add `TestHarness`: Manages a namespace-scoped Controller Manager and server instance per test case. This ensures resources from one test do not pollute the scheduler state of another. - Add DSL: Introduce intent-based builders (e.g., `ReqSubset`, `P`) and assertions (e.g., `ExpectRouteTo`) to decouple test logic from gRPC boilerplate. - Support deterministic synchronization by waiting for Prometheus metrics to settle before generating traffic.
Rewrite the hermetic integration suite to use the new isolated harness and DSL. - Migrate all existing test cases from epp_test.go to hermetic_test.go. - Enable pre-loading of base CRDs in TestMain to optimize setup time. - Remove legacy setup code and global variable reliance.
5177995 to
6e1742e
Compare
|
resolved merge conflict after rebasing |
What type of PR is this?
/kind test
/kind cleanup
What this PR does / why we need it:
This PR completes the migration of the integration test suite to the new isolated harness architecture. Following the pattern established in the Body-Based Routing (BBR) migration (#1959), this PR overhauls the EPP hermetic test suite.
The EPP tests are significantly more complex than BBR as they involve the full Kubernetes Controller Runtime lifecycle (Manager, Informers, Caches) and the Scheduler logic. This refactor introduces strict namespace isolation to prevent resource pollution between test cases and promotes server lifecycle logic to shared utilities. This will also be useful for future Flow Control tests which must modify pod metrics to toggle between saturated and unsaturated pool states.
Key Improvements
Namespace-Scoped Controller Manager:
TestHarness, which generates a unique Namespace (via UUID) for every test case.controller-runtimeManager with a namespace-scoped cache. This ensures that the EPP server under test only sees Pods and Pools relevant to the current test case, eliminating "ghost" resources from previous runs affecting scheduling decisions.t.Parallel()is disabled) because they rely on the singleton global Prometheus registry.Domain-Specific Language (DSL):
epp/util_test.go(e.g.,ReqSubset,P()for pod states) and assertions (e.g.,ExpectRouteTo,ExpectBufferResp).Deterministic Synchronization:
WaitForReadyPodsMetric. This blocks test execution until the internal scheduler state (via Prometheus metrics) matches the Kubernetes API state, preventing race conditions where requests are sent before the scheduler has indexed the backend pods.Shared Infrastructure:
127.0.0.1binding, TCP readiness checks) to the sharedtest/integrationpackage.Refactoring Note
test/integration/util.gostill retains some logic specific to the EPP domain. While these belong conceptually intest/integration/epp/util_test.go, I opted to keep them in the sharedutil.gopackage for this PR to minimize the already large diff size.Test Coverage Mapping
select lower queue and kv cache, no active loraselect lower queue and kv cacheselect active lora, low queueselect active lora, low queueselect lora despite higher kv cache usageselect lora despite higher kv cache (affinity)don't shed requests by defaultdo not shed requests by defaultinvalid json; return bodyinvalid json bodybody sent over multiple requests...split body across chunksno backend pods are availableno backend pods availablerequest don't contains invalid payload, model not existrequest missing model fieldsimple GET Requestprotocol: simple GET (header only)select active lora with subsetting tag, all pods availablesubsetting: select best from subsetselect active lora with subsetting tag, some pods matchsubsetting: partial matchselect active lora with subsetting tag, no pods availablesubsetting: no pods matchinferenceobjective's modelName is not translated, passthroughpassthrough: model not in objectivesrewrite request modelrewrite request modelresponsebody sent over multiple requests, content-type is json, bufferresponse buffering: multi-chunk JSONResponse is invalid json; return bodyresponse buffering: invalid JSONresponsebody sent over a single request...(JSON variant)response buffering: empty EOS chunk (JSON)responsebody sent over a single request...(SSE variant)response streaming: SSE token countingWhich issue(s) this PR fixes:
Refactoring groundwork necessary to support complex state-mutation tests (e.g., Flow Control) which require a strictly isolated environment.
Does this PR introduce a user-facing change?: