-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run after Reload reports assemblies multipletimes #609
Comments
Well... this seems to be due to the fact that Reload is basically not implemented in the engine... it just points to Load! I guess it was waiting for when we actually needed it. |
I'm outlining here how I'd like to finish the implementation of Reload. I'd appreciate comments from @ChrisMaddock @mikkelbu and other @nunit/engine-team members. The I think we should externally define reload as "reloading all tests, preserving as much of the current state as possible." The internal definition of Reload, as used in the The implication here is that an external call to Situations where an internal
In all of the above situations, the engine would simply do the best it could, performing an internal reload if possible but otherwise doing a full load. Other than performance differences, the result should not be distinguishable by the caller. The current implementation, taken from NUnit V2 only deals with the first situation - changes to the ProcessModel. We should implement handling of the other two. The current implementation does either a full reload or a full unload/load. Since we have a chain of runners involved, it's possible that we might be able to reuse some runners but not others. For example, if only the DomainUsage had changed, we should be able to reuse the same process and merely create new AppDomains and runners within that process. Currently, we would use an entire new process. We should eventually try to refine that, but it's probably not a high priority. Since I'm motivated to get this done for use by the GUI, I'll mention that the GUI already has some code to only call for a reload when it knows a full reload is possible. Ideally that would be removed and the GUI would rely completely on the engine to do what's right. |
I was about to disagree with your current PR, but I agree with your comment here instead! I agree that the engine should silently handle a call to reload, and silently workout whether a full load/unload is required, or just a reload of the test assemblies. |
Restarting work on this. Will do a simpler solution that eliminates the problem in the title without completely re-implementing Reload. |
This is pretty strange! The following sequence of calls to the master test runner...
... returns a result in which the test assembly appears twice. If the reload is repeated, then the result will have an additional copy of the assembly for each repetition.
This only appears after a Run. The result of the reload will seem quite normal.
Note that we don't use Reload in any of our runners, which is why this has gone undetected up to now.
The text was updated successfully, but these errors were encountered: