🐛 [Job] Device target status incorrect when re-executing a failed step. #4211
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.
Before this PR, you had a bug reproducible with these steps:
Create a Job with a single target
ensure the target device has device command enabled
ensure the device is connected before starting the job
Add three steps each one executing command “sleep 20”
Run the job
Make execution of the command fail in the middle of step with index “1”.
For example “kill” the device.
After a while the target status should be PROCESS_FAILED and Job should have terminated its execution
Execute the same job again
During re-execution of step with index “1” the state reported is PROCESS_FAILED which is not correct.
Expected behaviour:
During re-execution of step with index “1” the state reported should be PROCESS_AWAITING (for an asynchronous operation it should be AWAITING_COMPLETION or NOTIFIED_COMPLETION).
In this PR I fixed the bug restoring the expected behavior