Skip to content

[RayService] Assert rollback reason in TestReconcileRollbackState - #5076

Open
zacheryasc wants to merge 1 commit into
ray-project:masterfrom
zacheryasc:test/lock-rollback-reason-contract
Open

[RayService] Assert rollback reason in TestReconcileRollbackState#5076
zacheryasc wants to merge 1 commit into
ray-project:masterfrom
zacheryasc:test/lock-rollback-reason-contract

Conversation

@zacheryasc

Copy link
Copy Markdown

Why are these changes needed?

reconcileRollbackState sets the RollbackInProgress condition with reason DesiredClusterSpecChanged, but TestReconcileRollbackState asserted only the condition's boolean, never its reason. That let the #5022 rename (TargetClusterChanged -> DesiredClusterSpecChanged) drift at one of two callsites in rayservice_controller.go for ~9 days until the hotfix in #5063.

The new assertion checks the emitted reason, but only on the cases where the controller itself emits the condition (expectRollbackStatus && !isRollbackInProgress), excluding the pre-seeded "continues rolling back" path where the controller returns early without re-setting the condition.

Related issue number

No issue — test-only regression-prevention gap found while reviewing #5063 (the hotfix for the #5022 rename drift).

Labels

  • If this PR has user-facing changes that require documentation updates at release time, I have added the doc-updates-required label.
  • If this PR contains breaking changes, I have added the breaking-change label.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested 🙁

@zacheryasc

Copy link
Copy Markdown
Author

I know it's a small change, and debated opening a PR for this alone, but I checked the git history and there were similar small changes. Therefore, decided to have it standalone as opposed to riding some unrelated feature.

@machichima machichima left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That let the #5022 rename (TargetClusterChanged -> DesiredClusterSpecChanged) drift at one of two callsites in rayservice_controller.go for ~9 days until the hotfix in #5063.

The reason for CI failure after #5022 is because they forgot to merge master, so that the PR's CI does not catch it. But this fix is still good to have, thank you for catching this!

Comment thread ray-operator/controllers/ray/rayservice_controller_unit_test.go Outdated
@machichima

Copy link
Copy Markdown
Collaborator

@zacheryasc Please run pre-commit locally and fix the lint error, and fix the e2e test failure if it's related to this PR. Thank!

@zacheryasc
zacheryasc force-pushed the test/lock-rollback-reason-contract branch 2 times, most recently from bed347f to 3372df4 Compare August 6, 2026 06:54
@zacheryasc

Copy link
Copy Markdown
Author

@zacheryasc Please run pre-commit locally and fix the lint error, and fix the e2e test failure if it's related to this PR. Thank!

Embarrassing! Lint has been fixed. It seems like the other failing CI is unrelated. Current master is broken for this file (see #5096), waiting on upstream fix and I'll FF onto it.

@machichima

Copy link
Copy Markdown
Collaborator

@zacheryasc the error is fixed on master

reconcileRollbackState sets the RollbackInProgress condition with reason
DesiredClusterSpecChanged, but TestReconcileRollbackState asserted only
the condition's boolean, never its reason. That let the ray-project#5022 rename
(TargetClusterChanged -> DesiredClusterSpecChanged) drift at one of two
callsites for 9 days until the hotfix in ray-project#5063.

Assert the reason, but only on the cases where the controller itself
emits the condition (expectRollbackStatus && !isRollbackInProgress),
excluding the pre-seeded "continues rolling back" path where the
controller returns early without re-setting the condition.
@zacheryasc
zacheryasc force-pushed the test/lock-rollback-reason-contract branch from 3372df4 to d6b2b30 Compare August 7, 2026 09:28
@machichima

Copy link
Copy Markdown
Collaborator

@zacheryasc Please ping me again when all CI are green. Thanks!

@zacheryasc

Copy link
Copy Markdown
Author

@machichima green to go

@machichima machichima left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you. cc @rueian or @andrewsykim to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants