Ensure self.process is None in CommandRunner in case it's reused #235
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
Tiny fix, for something I noticed after deploying the latest agent code.
We reuse the CommandRunner throughout the duration of a single job phase. We currently send the banner output for the top of the test phase as commands so that it goes to all the right logs, output buffer, etc. But there's a chance that the old process can be left over when we restart a new on, and this can result in the output not streaming properly from the command. Fortunately, the fix is pretty easy - just ensure that we reset self.process back to None before starting a command each time.
Tests
I tested this both locally after reproducing it, and with a real agent in the lab and was able to see the output streaming properly after I pushed the fix.