Eliminate use of StopRun(true) - #1858
Conversation
|
@manfred-brands
It would be be useful if you'd take a look at the PR as it is now and let me know what you think. |
I have raised nunit/nunit#5374 I left the signature for the FrameworkController the same (similar what you did earlier). |
|
On the other items...
I'll have the agent just terminate itself when it receives a
For now, I'm going to turn the tracker code back on. |
|
@manfred-brands This is ready for review. I've left a few things for a later issue/PR...
|
manfred-brands
left a comment
There was a problem hiding this comment.
A few small suggestions.
|
|
||
| [Test] | ||
| public void StopRun_Throws_NUnitEngineException() | ||
| public void StopRun_Throws_ArgumentException() |
There was a problem hiding this comment.
This method is looks identical to StopRun_Passes_Along_NUnitEngineException.
Proofing that _runner.ForcedStop() calls _driver.ForcedStop()
| ID = id; | ||
| _nunitVersion = nunitRef.Version.ShouldNotBeNull(); | ||
|
|
||
| if (nunitRef.Version >= MINIMUM_NUNIT_VERSION) |
There was a problem hiding this comment.
Can use the new field.
| if (nunitRef.Version >= MINIMUM_NUNIT_VERSION) | |
| if (_nunitVersion >= MINIMUM_NUNIT_VERSION) |
| if (_api.ForcedStopSupported) | ||
| _api.ForcedStop(); | ||
| else | ||
| Process.GetCurrentProcess().Kill(); |
There was a problem hiding this comment.
Is that not the same as calling Exit?
| Process.GetCurrentProcess().Kill(); | |
| Environment.Exit(1); |
|
Thanks. Good suggestions. I'll put them in and merge in the morning. |
|
@manfred-brands FYI, added a new exit code for the agent, CANCELLED_BY_FORCED_STOP = -6; |
Eliminates use of
StopRun(bool)in the engine and agent core and fixes #1856.StopRun(false)is replaced byRequestStop(), which is intended to make it clear that the test may not stop. The caller may only request it and the result depends on the test framework, possibly its version and the test code itself.StopRun(true)is replace byForcedStop(). If the test framework provides any facilities for such a stop, they are used. Otherwise, any non terminated processes are canceled by the engine.The initial commit makes the necessary replacements but code to kill agent processes is not yet implemented.