-
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
Nunit 3.4.1 NUnit.Engine.Runners #31
Comments
I have the same issue in our testing framework with nunit-agent-x86.exe when using version 3.5.0 for both the framework and the console runner:
We are currently migrating to 64-bit. I don't know if this issue also occurs with nunit-agent.exe? |
@l0bd0n The |
@CharliePoole So catching this exception and verifying that the runner has terminated is then fine? |
I used this step in TeamCity as first step, I'm not sure if this problem still exist. echo off |
We are currently migrating from MbUnit to NUnit. We use TeamCity 10.0.3 and we have now the same issue as described above. We also had similar issues using Gallio Testrunner while using MbUnit: The symptoms look quiet similar to me. Could an antivirus program cause this issue? |
@l0bd0n If you are calling the engine programatically, you could decide to ignore the exception. It's still a problem for us to fix, of course. @eberlid There is a timeout while waiting for the agent to load. So if your antivirus spends a lot of time checking whether the assembly is OK to load, it would be possible to cause a timeout. In most dev environments, you don't want this kind of slowdown. |
I believe this is fixed by #161. Please reopen if I am wrong. |
Unfortunately, the problem still exists. Am I right that the mentioned fix #161 does only affect Console Runner? We are currently running the tests with the Console Runner 3.6.0 but still get this Socket Exceptions (test assemblies are compiled against 3.5.0) The machine normally runs two TeamCity agents; Sometimes only one is active. I cannot say for sure, but it seems that the Socket Exceptions are more frequently when the machine is under high load, i.e., both agents are running rather than only one. The machine is equipped with 8 GB RAM, SSD and a Xeon E5-1620 v2 CPU. We thought that timing issues may cause the problem, i.e., starting to wait for a process to finish but it has already finished...? Shall I create a new issue for that? |
@rprouse #161 fixes #128, which is unrelated to this issue. The fixed issue has to do with the agent failing to terminate. As my comments show, I had the impression that the OP was calling the engine from a program and was simply doing it wrong. But on rereading, I think I may have been wrong. We probably need a new description of what the problem is. |
@CharliePoole I see you asked "We probably need a new description of what the problem is." |
@heldersepu The link you gave shows an exception being thrown in a run of nunit-console V2, which is quite different from any issues in this repository. Not sure if you need a new issue or if you meant to link to a different example. |
We believe this was fixed by #223 which will be released as part of 3.7. If you'd like to confirm sooner that the issue is fixed, please try If it turns out that this does not fix your issue, please reopen and comment. |
@elinato commented on Fri Jul 15 2016
I run into problems, Nunit 3.4.1 sometimes doesn't terminate nunit-agent-x86.exe, using TeamCity
I get this from TeamCity:
[Step 6/6] Unhandled Exception: System.InvalidOperationException: LocalDataStoreSlot storage has been freed. [10:38:55][Step 6/6] at System.LocalDataStore.SetData(LocalDataStoreSlot slot, Object data) [10:38:55][Step 6/6] at System.Threading.Thread.SetData(LocalDataStoreSlot slot, Object data) [10:38:55][Step 6/6] at System.Windows.Interop.ComponentDispatcher.get_CurrentThreadData() [10:38:55][Step 6/6] at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) [10:38:55][Step 6/6] at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) [10:38:55][Step 6/6] at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) [10:38:55][Step 6/6] at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) [10:38:55][Step 6/6] at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) [10:38:55][Step 6/6] at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) [10:38:55][Step 6/6] at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) [10:38:58][Step 6/6] System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host [10:38:58][Step 6/6] [10:38:58][Step 6/6] Server stack trace: [10:38:58][Step 6/6] at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 size) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffer, Int32 offset, Int32 count) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.SocketHandler.Read(Byte[] buffer, Int32 offset, Int32 count) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.SocketHandler.ReadAndMatchFourBytes(Byte[] buffer) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadAndMatchPreamble() [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.Tcp.TcpSocketHandler.ReadVersionAndOperation(UInt16& operation) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.Tcp.TcpClientSocketHandler.ReadHeaders() [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) [10:38:58][Step 6/6] at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg) [10:38:58][Step 6/6] [10:38:58][Step 6/6] Exception rethrown at [0]: [10:38:58][Step 6/6] at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) [10:38:58][Step 6/6] at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) [10:38:58][Step 6/6] at NUnit.Engine.ITestEngineRunner.Unload() [10:38:58][Step 6/6] at NUnit.Engine.Runners.ProcessRunner.UnloadPackage() [10:38:58][Step 6/6] at NUnit.Engine.Runners.AbstractTestRunner.Unload() [10:38:58][Step 6/6] at NUnit.Engine.Runners.AggregatingTestRunner.UnloadPackage() [10:38:58][Step 6/6] at NUnit.Engine.Runners.AbstractTestRunner.Unload() [10:38:58][Step 6/6] at NUnit.Engine.Runners.MasterTestRunner.UnloadPackage() [10:38:58][Step 6/6] at NUnit.Engine.Runners.AbstractTestRunner.Dispose(Boolean disposing) [10:38:58][Step 6/6] at NUnit.Engine.Runners.MasterTestRunner.Dispose(Boolean disposing) [10:38:58][Step 6/6] at NUnit.Engine.Runners.AbstractTestRunner.Dispose() [10:38:58][Step 6/6] at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter) [10:38:58][Step 6/6] at NUnit.ConsoleRunner.Program.Main(String[] args) [10:38:58][Step 6/6] Process exited with code -100 [10:38:58][Step 6/6] Step Run tests (NUnit) failed
@CharliePoole commented on Fri Jul 15 2016
Based on the stacktrace, it does not seem to be the case that the agent process fails to terminate. In fact there is a SocketException with the message "An existing connection was forcibly closed by the remote host" which would usually indicate that the agent had already terminated.
That's a normal situation after a run has terminated so I'm uncertain why it causes a problem with Teamcity. Are you absolutely sure that TC is using NUnit 3.4.1?
@elinato commented on Sun Jul 17 2016
In TeamCity I use this command line: packages\NUnit.ConsoleRunner.3.4.1\tools\nunit3-console.exe
The text was updated successfully, but these errors were encountered: