Nunit在运行测试套件时锁定

时间:2012-02-27 00:14:07

标签: selenium locking nunit block

当我尝试在NUnit中运行测试套件时,我遇到了问题。它在运行测试时锁定,然后显示此错误消息。我使用了最新版本的NUnit,并使用c#,Visual Studio 2010和Selenium Client Drivers 2.12编写了这些测试。

任何想法?。

错误明细:

有关调用

的详细信息,请参阅此消息的结尾

实时(JIT)调试而不是此对话框。

********** 异常文字 **********

System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:4829



    Server stack trace:



   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)

   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)

   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)

   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()

   at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()

   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)

   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)

   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)

   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)



Exception rethrown at [0]: 

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

   at NUnit.Core.TestRunner.get_Running()

   at NUnit.Core.ProxyTestRunner.get_Running()

   at NUnit.Util.TestLoader.get_Running()

   at NUnit.Gui.NUnitForm.get_IsTestRunning()

   at NUnit.Gui.NUnitForm.NUnitForm_Closing(Object sender, CancelEventArgs e)

   at System.Windows.Forms.Form.OnClosing(CancelEventArgs e)

   at System.Windows.Forms.Form.WmClose(Message& m)

   at System.Windows.Forms.Form.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

********** 已加载程序集 **********

mscorlib程序

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3625 (GDR.050727-3600)

CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

NUnit的

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/nunit.exe

NUnit的贵浇道

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/lib/nunit-gui-runner.DLL

nunit.core

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/lib/nunit.core.DLL

nunit.util

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/lib/nunit.util.DLL

nunit.uikit

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/lib/nunit.uikit.DLL

System.Windows.Forms的

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3623 (GDR.050727-3600)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

系统

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3624 (GDR.050727-3600)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing中

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

nunit.core.interfaces

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/lib/nunit.core.interfaces.DLL

System.Configuration

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

的System.Xml

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3082 (QFE.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

System.Runtime.Remoting

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

nunit.uiexception

Assembly Version: 2.5.10.11092

Win32 Version: 2.5.10.11092

CodeBase: file:///C:/Program%20Files/NUnit%202.5.10/bin/net-2.0/lib/nunit.uiexception.DLL

的System.Web

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3618 (GDR.050727-3600)

CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll

cdqzko4t

Assembly Version: 2.5.10.11092

Win32 Version: 2.0.50727.3624 (GDR.050727-3600)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

********** JIT调试 **********

启用实时(JIT)调试,此

的.config文件

应用程序或计算机(machine.config)必须具有

在system.windows.forms部分设置的jitDebugging值。

还必须使用调试

编译应用程序

启用。

例如:

<system.windows.forms jitDebugging="true" />

启用JIT调试时,任何未处理的异常

将被发送到计算机上注册的JIT调试器

而不是由此对话框处理。

2 个答案:

答案 0 :(得分:2)

我遇到了同样的异常,我发现了很多关于它的线索。有a bug,可能会在您的情况下产生问题。

在我的情况下,我使用NUnit版本2.6.0.1205,其中已经修复了错误。所以我的情况与bug中描述的情况不同。 问题是,因为我将输出应用程序类型和目标框架从控制台应用程序 .NET Framework 4客户端配置文件更改为类库 .NET Framework 4

解决方案是将它们更改回控制台应用程序 .NET Framework 4客户端配置文件

这不是问题的确切答案,但我希望它能帮助那些遇到同样问题的人。

更新:此异常的另一种情况是其中一个测试终止该过程。例如,如果测试从另一个调用exit的DLL调用C / C ++函数,就会发生这种情况。

答案 1 :(得分:0)

我遇到了同样的问题,但我设法通过创建一个新的NUnit项目并重新加载程序集来修复它。