ci: cancel previous test_plans implementation & fix cancel CI task#22861
Merged
auspham merged 1 commit intosonic-net:masterfrom Mar 23, 2026
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
9d9dfae to
61ff9ec
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
61ff9ec to
d6036a6
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
d6036a6 to
b983bca
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
b983bca to
80f7367
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
80f7367 to
81740db
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
81740db to
a656a21
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
a656a21 to
933fb87
Compare
wangxin
reviewed
Mar 23, 2026
499df51 to
8c3a59a
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Austin Pham <austinpham@microsoft.com>
8c3a59a to
cbac654
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
xwjiang-ms
reviewed
Mar 23, 2026
xwjiang-ms
reviewed
Mar 23, 2026
| - stage: Test | ||
| dependsOn: Pre_test | ||
| condition: and(succeeded(), in(dependencies.Pre_test.result, 'Succeeded')) | ||
| condition: and(succeeded(), not(canceled()), in(dependencies.Pre_test.result, 'Succeeded')) |
Contributor
There was a problem hiding this comment.
Is it necessary to add not canceled?
wangxin
approved these changes
Mar 23, 2026
mssonicbld
pushed a commit
that referenced
this pull request
Mar 23, 2026
What is the motivation for this PR? Currently, when running a new testplan, there is no safety check to cancel all the previous dangling job. This add the ability to test_plan.py to cancel all related job with PR number using cancel_pr. However this PR does not add the call, only the implementation. The real call will be implemented in #22861 How did you do it? Added a cancel_pr method that hits Elastictest endpoint API to cancel all previous job for the same PR How did you verify/test it? Verified locally and manually using CI Signed-off-by: Austin Pham <austinpham@microsoft.com> Signed-off-by: mssonicbld <sonicbld@microsoft.com>
vrajeshe
pushed a commit
to vrajeshe/sonic-mgmt
that referenced
this pull request
Mar 23, 2026
What is the motivation for this PR? Currently, when running a new testplan, there is no safety check to cancel all the previous dangling job. This add the ability to test_plan.py to cancel all related job with PR number using cancel_pr. However this PR does not add the call, only the implementation. The real call will be implemented in sonic-net#22861 How did you do it? Added a cancel_pr method that hits Elastictest endpoint API to cancel all previous job for the same PR How did you verify/test it? Verified locally and manually using CI Signed-off-by: Austin Pham <austinpham@microsoft.com> Signed-off-by: Venkata Gouri Rajesh Etla <vrajeshe@cisco.com>
Contributor
Author
|
TODO: cherry-pick into 202505 and 202511 |
mssonicbld
added a commit
that referenced
this pull request
Mar 25, 2026
What is the motivation for this PR? Currently, when running a new testplan, there is no safety check to cancel all the previous dangling job. This add the ability to test_plan.py to cancel all related job with PR number using cancel_pr. However this PR does not add the call, only the implementation. The real call will be implemented in #22861 How did you do it? Added a cancel_pr method that hits Elastictest endpoint API to cancel all previous job for the same PR How did you verify/test it? Verified locally and manually using CI Signed-off-by: Austin Pham <austinpham@microsoft.com> Signed-off-by: mssonicbld <sonicbld@microsoft.com> Co-authored-by: Austin (Thang Pham) <austinpham@microsoft.com>
Collaborator
|
@auspham PR conflicts with 202505 branch |
Collaborator
|
@auspham PR conflicts with 202511 branch |
This was referenced Mar 26, 2026
vmittal-msft
pushed a commit
that referenced
this pull request
Mar 26, 2026
* ci: cancel previous test_plans implementation Signed-off-by: Austin Pham <austinpham@microsoft.com> * fix: added default parameters for cancel pr pipeline Signed-off-by: Austin Pham <austinpham@microsoft.com> --------- Signed-off-by: Austin Pham <austinpham@microsoft.com>
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
PREREQUISITE: #23101 to be merged
Summary: PRs that triggered multiply with
/azpw rundon't have the clean up resources by default. This will make sure for every new pipeline start, we will try to clear previous test plans from Elastictest to optimise resource utilisationThis PR also fix the problem where pressing the 'Cancel' button doesn't cancel the testplan/job
Fixes # (issue) 37065882
Type of change
Back port request
Approach
What is the motivation for this PR?
There are 2 problems:
How did you do it?
For 1. Introduce #23101 mechanism to cancel all the related pipeline before starting the test plan. This will make sure that before the pipeline start, all the related resources previously is cleaned up
For 2. This PR implement a guard condition that cancel the job when the Cancel button pressed.
How did you verify/test it?
Verified manually
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation