Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix waitTime and approval task blocking each other #1063

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

jwtty
Copy link
Contributor

@jwtty jwtty commented Feb 28, 2025

Description of your changes

Fix an issue that when both Timedwait and Approval after-stage tasks are present, it might block each other: the ApprovalReq is only created after wait time has passed; the wait time check is only done when the ApprovalReq is approved.

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@jwtty jwtty changed the title fix waitTime and approval task blocking each other fix: fix waitTime and approval task blocking each other Feb 28, 2025
@jwtty jwtty force-pushed the stagerun-waittimefix branch from bf7ab38 to 83f9e25 Compare March 4, 2025 08:20
}
} else {
// Approved state should not change once the approval is accepted.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Approved state should not change once the approval is accepted.
// We land here only if the approval is accepted. Approved state should not change once the approval is accepted.

@@ -181,7 +173,355 @@ var _ = Describe("UpdateRun execution tests", func() {
clusterResourceOverride = nil
})

Context("Cluster staged update run should update clusters one by one", Ordered, func() {
Context("Cluster staged update run should update clusters one by one - strategy with double afterStageTasks", Ordered, func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to avoid copy paste the a large part of the test case?

@@ -753,7 +753,7 @@ func generateSucceededInitializationStatus(
updateStrategy *placementv1beta1.ClusterStagedUpdateStrategy,
clusterResourceOverride *placementv1alpha1.ClusterResourceOverrideSnapshot,
) *placementv1beta1.StagedUpdateRunStatus {
return &placementv1beta1.StagedUpdateRunStatus{
status := &placementv1beta1.StagedUpdateRunStatus{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we are reusing util functions across the different integration tests suites. Maybe we can move them all into a common test_util file just like the e2e does? Not blocking this PR.

@jwtty jwtty merged commit 7952705 into Azure:main Mar 4, 2025
12 checks passed
@jwtty jwtty deleted the stagerun-waittimefix branch March 4, 2025 22:25
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