Skip to content

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

Merged
jwtty merged 2 commits intoAzure:mainfrom
jwtty:stagerun-waittimefix
Mar 4, 2025
Merged

fix: fix waitTime and approval task blocking each other#1063
jwtty merged 2 commits intoAzure:mainfrom
jwtty:stagerun-waittimefix

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.

})

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?

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