Repository navigation
test/load_aware_locality: Optimize with simtime and connection reuse - #49074
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The simulated-time and connection-reuse changes have no active review issues.
No open issues 🎉
What changed in this PR
This PR reduces load-aware locality integration test overhead by using simulated time for weight updates and reusing connections across requests.
Changes:
- Replace real-time waits with simulated time in the test fixture.
- Reuse downstream and per-upstream connections, closing them during teardown.
- Remove the test’s
largesize designation and add the simulated-time dependency.
| File | Description |
|---|---|
test/extensions/load_balancing_policies/load_aware_locality/integration_test.cc |
Use simulated time and persistent connections for load-balancer sampling. |
test/extensions/load_balancing_policies/load_aware_locality/BUILD |
Add the simulated-time dependency and remove the large test size. |
Review effort: Balanced
phlax
force-pushed
the
load-aware-locality-test-sim-time
branch
from
November 11, 2026 23:33
4c6c913 to
a453756
Compare
Member
Author
|
@nezdolik @tonya11en ptal - rebased to main. |
`LoadAwareLocalityIntegrationTest::advanceWeightTick()` called `advanceTimeWait(11s)` on the real time system, i.e. it slept 11s per weight-update period. Ten ticks per IP version made the (unsharded) target run ~250s, hidden behind `size = "large"`, and it regularly ends the test phase of CI jobs that invalidate `test/integration`. Use simulated time for the fixture: the LB's weight-update timer runs on the main dispatcher and the utilization freshness check compares monotonic timestamps, so advancing simulated time by the same 11s drives exactly the same tick with the same inputs. Drop the test size. `sendRequestWithOrcaResponse()` opened a downstream connection, waited for a fresh upstream connection and closed both for every one of the ~1000 requests each IP version sends. Keep the downstream connection and one fake connection per upstream open for the duration of a test and wait for the next stream on any of them, so the sampling exercises Envoy's pools the way traffic would and the test no longer spends its time on connect/close pairs. Signed-off-by: Ryan Northey <[email protected]>
phlax
force-pushed
the
load-aware-locality-test-sim-time
branch
from
November 13, 2026 13:22
a453756 to
a749843
Compare
ravenblackx
approved these changes
Nov 13, 2026
ravenblackx
left a comment
Contributor
There was a problem hiding this comment.
Looks like something that would be good as a standard integration test helper function rather than implemented for only this one test, but this is fine.
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#49074) `LoadAwareLocalityIntegrationTest::advanceWeightTick()` called `advanceTimeWait(11s)` on the real time system, i.e. it slept 11s per weight-update period. Ten ticks per IP version made the (unsharded) target run ~250s, hidden behind `size = "large"`, and it regularly ends the test phase of CI jobs that invalidate `test/integration`. Use simulated time for the fixture: the LB's weight-update timer runs on the main dispatcher and the utilization freshness check compares monotonic timestamps, so advancing simulated time by the same 11s drives exactly the same tick with the same inputs. Drop the test size. `sendRequestWithOrcaResponse()` opened a downstream connection, waited for a fresh upstream connection and closed both for every one of the ~1000 requests each IP version sends. Keep the downstream connection and one fake connection per upstream open for the duration of a test and wait for the next stream on any of them, so the sampling exercises Envoy's pools the way traffic would and the test no longer spends its time on connect/close pairs. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b65ee4b) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…nvoyproxy#49074) `LoadAwareLocalityIntegrationTest::advanceWeightTick()` called `advanceTimeWait(11s)` on the real time system, i.e. it slept 11s per weight-update period. Ten ticks per IP version made the (unsharded) target run ~250s, hidden behind `size = "large"`, and it regularly ends the test phase of CI jobs that invalidate `test/integration`. Use simulated time for the fixture: the LB's weight-update timer runs on the main dispatcher and the utilization freshness check compares monotonic timestamps, so advancing simulated time by the same 11s drives exactly the same tick with the same inputs. Drop the test size. `sendRequestWithOrcaResponse()` opened a downstream connection, waited for a fresh upstream connection and closed both for every one of the ~1000 requests each IP version sends. Keep the downstream connection and one fake connection per upstream open for the duration of a test and wait for the next stream on any of them, so the sampling exercises Envoy's pools the way traffic would and the test no longer spends its time on connect/close pairs. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b65ee4b) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
that referenced
this pull request
Nov 17, 2026
…49074) `LoadAwareLocalityIntegrationTest::advanceWeightTick()` called `advanceTimeWait(11s)` on the real time system, i.e. it slept 11s per weight-update period. Ten ticks per IP version made the (unsharded) target run ~250s, hidden behind `size = "large"`, and it regularly ends the test phase of CI jobs that invalidate `test/integration`. Use simulated time for the fixture: the LB's weight-update timer runs on the main dispatcher and the utilization freshness check compares monotonic timestamps, so advancing simulated time by the same 11s drives exactly the same tick with the same inputs. Drop the test size. `sendRequestWithOrcaResponse()` opened a downstream connection, waited for a fresh upstream connection and closed both for every one of the ~1000 requests each IP version sends. Keep the downstream connection and one fake connection per upstream open for the duration of a test and wait for the next stream on any of them, so the sampling exercises Envoy's pools the way traffic would and the test no longer spends its time on connect/close pairs. Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b65ee4b) Signed-off-by: Ryan Northey <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LoadAwareLocalityIntegrationTest::advanceWeightTick()calledadvanceTimeWait(11s)on the real time system, i.e. it slept 11s per weight-update period. Ten ticks per IP version made the (unsharded) target run ~250s, hidden behindsize = "large", and it regularly ends the test phase of CI jobs that invalidatetest/integration.Use simulated time for the fixture: the LB's weight-update timer runs on the main dispatcher and the utilization freshness check compares monotonic timestamps, so advancing simulated time by the same 11s drives exactly the same tick with the same inputs. Drop the test size.
sendRequestWithOrcaResponse()opened a downstream connection, waited for a fresh upstream connection and closed both for every one of the ~1000 requests each IP version sends. Keep the downstream connection and one fake connection per upstream open for the duration of a test and wait for the next stream on any of them, so the sampling exercises Envoy's pools the way traffic would and the test no longer spends its time on connect/close pairs.