fix(agent): make sure phase exit codes are in the 0-255 range #385
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
When a process is terminated due to a "stop condition checker", it ends up receiving a SIGKILL and the
returncode
for a process that receives a SIGKILL (signal 9) is -9. Thatreturncode
is used as the exit status of the phase, which means that exit statuses reported by Testflinger can be negative, rather than in the expected range of 0-255.This PR ensures that phase exit codes are in the 0-255 range.
Tests
In a local Testflinger deployment, this job was used for testing, deliberately timing out:
Here are the results when the agent was deployed from
main
:And here are the results when the agent was deployed from this branch: