[History Server] Replace private getter assertions with BuildSnapshot() in history server unit tests#4949
Open
dalaoqi wants to merge 2 commits into
Open
Conversation
…() in history server unit tests (ray-project#4937) Signed-off-by: Tsung-Han Ho (Miles Ho) <mystes3016@gmail.com>
dalaoqi
marked this pull request as ready for review
June 24, 2026 17:34
JiangJiaWei1103
approved these changes
Jun 28, 2026
JiangJiaWei1103
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for contribution!
nit (non-blocking): Could bind snap := h.BuildSnapshot(clusterInfo) once and read snap.Actors[id] / snap.Jobs[id] / snap.Nodes off it?
chiayi
self-requested a review
June 29, 2026 17:41
chiayi
approved these changes
Jun 29, 2026
…g fields Signed-off-by: Tsung-Han Ho (Miles Ho) <mystes3016@gmail.com>
Contributor
Author
|
@JiangJiaWei1103 Done, bound to snap and read fields off it. Thanks! |
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.
Why are these changes needed?
The unit tests asserted on internal state via the private getters
getActorsMap,getJobsMap, andgetNodeMap, coupling the tests to implementation details. SinceBuildSnapshot()is the only exported accessor and is the single source of truth for what we serve, the tests now assert on the snapshot'sActors,Jobs, andNodesfields instead.Related issue number
Closes #4937
Checks