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.
This PR solves issue #1144 reported in the TestCentric GUI project.
When a forced stop is executed on a test run the entire agent process is getting terminated. We cannot use the identical agent or runner for the next test run, but instead we need to create new ones. However the member variables still references the outdated agent and continue trying to communicate with it.
The fix resets these two member variables so that the agent and runner are created newly with the next test run.
In addition also a small fix in the
TestEventDispatcher
class was required:When a force stop is executed the
_runCancelled
variable is set to true. In this state no test events are fired anymore.However there is no code location which reset this variable back to false, so as consequence the agent will not fire any events at all once force stop was executed.
I was not sure in which code location to add the reset of this variable best. But finally decided to place it into the method
InitializeForRun
. This means whenever a new test run starts, this variable is reset.Overall the scenario mentioned in the issue will be fixed by this PR.