Add end-to-end tests for IntermediateStateCalcStageV2 availability-aware prioritization#133
Open
ngngwr wants to merge 1 commit intolinkedin:devfrom
Open
Conversation
…y-aware prioritization TestIntermediateStateCalcStageV2: Subclass that runs all 8 V1 tests with V2 enabled via setIntermediateStateCalcStageV2Enabled(true), verifying backward compatibility of the V2 pipeline. TestIntermediateStateCalcStageV2AvailabilityAware: Extends V2 tests with availability-aware prioritization enabled. Inherits 9 V1/V2 tests plus adds 3 new scenarios: - testAvailabilityAwarePrioritizesMostDegradedResource: verifies fully-degraded resources (top state missing, score 1M) win recovery slots over partially-degraded - testAvailabilityAwareHandoffPrioritizedOverUpwardTransition: verifies top-state handoff (score 999K) wins over normal upward transitions - testAvailabilityAwareOrdersByDegradationForLoadBalance: verifies the upward score gradient (minActive/(currentActive+1)) correctly orders load-balance messages so more-degraded resources get priority under tight throttle budgets Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Issues
Follow-up to #131 — adds end-to-end test coverage for the V2 pipeline and availability-aware ordering code path.
Description
PR #131 added the V2 config flag and delegation logic but had zero end-to-end tests for the availability-aware code path (
IntermediateStateCalcStageV2.java:118-120). This PR closes that gap with two new test classes:TestIntermediateStateCalcStageV2— Subclass that runs all 8 V1IntermediateStateCalcStagetests with V2 enabled viasetIntermediateStateCalcStageV2Enabled(true), verifying backward compatibility of the V2 pipeline.TestIntermediateStateCalcStageV2AvailabilityAware— Extends V2 tests with availability-aware prioritization enabled. Inherits 9 V1/V2 tests plus adds 3 new scenarios that verify availability-aware-specific ordering behavior under tight throttle budgets:minActive/(currentActive+1)correctly prioritizes more-degraded resources for load-balance messagesTests
The following tests are written for this issue:
TestIntermediateStateCalcStageV2— 9 tests (8 inherited V1 + 1 routing guard)TestIntermediateStateCalcStageV2AvailabilityAware#testAvailabilityAwarePrioritizesMostDegradedResourceTestIntermediateStateCalcStageV2AvailabilityAware#testAvailabilityAwareHandoffPrioritizedOverUpwardTransitionTestIntermediateStateCalcStageV2AvailabilityAware#testAvailabilityAwareOrdersByDegradationForLoadBalanceThe following is the result of the "mvn test" command on the appropriate module:
Changes that Break Backward Compatibility (Optional)
None. This PR adds test files only — no production code changes.
Commits