Repository navigation
YARN-12023. Make TestCapacityOverTimePolicy independent of the time of day - #8814
Open
joseluisll wants to merge 2 commits into
Open
joseluisll wants to merge 2 commits into
joseluisll wants to merge 2 commits into
Conversation
…f day. BaseSharingPolicyTest#generateRLEAlloc folded a reservation onto its period starting at initTime % period, with initTime taken from the wall clock. Its wrap-around arithmetic lost one full period whenever the remainder of the duration wrapped past the period end, e.g. a 25h reservation on a 1-day period generated only ~1h of allocation when the test ran between 23:00 and 24:00 UTC, so the expected PlanningQuotaException for that case was not thrown. Generate floor(duration / period) full periods plus the remainder starting at initTime % period, wrapping it if needed, so the generated allocation always amounts to duration. Also use a fixed initTime, as PeriodicRLESparseResourceAllocation#getRangeOverlapping can return an open-ended allocation when a step lands exactly on the range end, which makes CapacityOverTimePolicy reject some cases for that reason (YARN-12022) instead of the one under test at a few specific times of day. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joseluisll
force-pushed
the
YARN-12023-upstream
branch
from
October 12, 2026 11:52
9b1a8cd to
35ef59a
Compare
|
🎊 +1 overall
This message was automatically generated. |
This branch has not been deployed
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.
Description of PR
JIRA: https://issues.apache.org/jira/browse/YARN-12023
BaseSharingPolicyTest#generateRLEAllocfolded a reservation onto its period starting atinitTime % period, withinitTimetaken from the wall clock. Its wrap-around arithmetic dropped one full period whenever the rest of the duration wrapped past the end of the period. For example, a 25h reservation on a 1-day period produced only about 1h of allocation when the test ran between 23:00 and 24:00 UTC, so the expectedPlanningQuotaExceptionfor that case was never thrown.This change:
floor(duration / period)full periods plus the remainder, starting atinitTime % periodand wrapping when needed, so the generated allocation always adds up toduration.initTime. At a few specific times of day,PeriodicRLESparseResourceAllocation#getRangeOverlappingcan return an open-ended allocation when a step lands exactly on the range end (tracked separately as YARN-12022).CapacityOverTimePolicythen rejects some cases for that reason instead of the one under test.This is a test-only change in
BaseSharingPolicyTest, which affectsTestCapacityOverTimePolicyandTestNoOverCommitPolicy.How was this patch tested?
Test-only change; covered by
TestCapacityOverTimePolicyandTestNoOverCommitPolicyinhadoop-yarn-server-resourcemanager.For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles? (N/A)AI Tooling
Contains content generated by Claude Code.