-
-
Notifications
You must be signed in to change notification settings - Fork 782
5222 - Skip action update if execution already in completed state. #5293
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
Conversation
m4dcoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't completely recall but I think there may be some edge cases impacted by this. One test case I can think of is with items task in which one of the executions for an item failed, this leads to the workflow execution going into failed state. However, items that are still in progress are allowed to update result into the execution. I suggest getting CI jobs here to completely pass so we know it is not impacting other documented test cases.
- Please make sure there's unit test associated with your change.
- Have you tested this change locally on your workflows? Did it completely resolve?
|
Please find response inline @m4dcoder
----> All the test cases are fixed now. The one-off edge case you mentioned regarding with-items failure is verified with test_with_items_failure test case which is running fine.
----> Unit test case added st2common/tests/unit/test_executions_util.py
----> Yes, I've verified the changes locally. I've setup an environment where I'm able to reproduce the race condition. With my changes, you can see the status not changing to running after it succeeded. Also, added screenshot of log line when execution update was skipped. |
m4dcoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything passes. But I have some more questions, specifically the patching in the unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I don't have any issue with the changes since all unit and integrate tests pass and the concern address from the change is valid. I requested some minor cleanups. I will approve when cleanups are addressed and everything goes green.
@m4dcoder All review comments addressed. Please approve and merge. |
m4dcoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, still missing some cleanups. Can you check the unit tests that you've refactored and make sure there are no duplicate query/asserts on the live action and action execution? If there are asserts that are out of place after the cleanup, please move them closer to where they should be checked (i.e. move live action result check closer to where the status was checked).
contrib/runners/orquesta_runner/tests/unit/test_error_handling.py
Outdated
Show resolved
Hide resolved
@m4dcoder All test case cleanups are addressed. |
m4dcoder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!




Race condition causing orquesta workflow status to change to running after it completed successfully. To avoid this incorrect status update, skipping execution object update is execution is already in completed state.
More details about issue: #5222