I am setting up Microsoft Test Manager in order to playback recorded manual tests for Propeople. I created a test case and set up my environment to collect data from web server.
However when I tried to start recording of my manual test with Microsoft Test Manager, I’ve got the error below:
Data and diagnostics cannot be collected
An error occurred while initializing diagnostic data adapters.
Timed out while initializing data and diagnostics adapters.
To increase the timeout values for all diagnostic data adapters, see the following link: http://go.microsoft.com/fwlink/?LinkId=169311.
I started poking around in Event Viewer in my local machine, test controller and test agent machines and I found some errors log at the Test Controller machine (pasting full error details so next poor soul can find it).
(QTController.exe, PID 4660, Thread 26) ControllerExecution: Exception: System.Net.Sockets.SocketException (0x80004005): No such host is known
Server stack trace:
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
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 Microsoft.VisualStudio.TestTools.Controller.IControllerEvents.ControllerEvent(TestMessage report)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.<>c__DisplayClass1d.<CallListeners>b__19(IControllerEvents eventListener)
at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer`1.InvokeAsRemoteUser(Action`1 invoke)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.CallListeners(TestMessage testMessage)
The “No such host is known” exception is too general and I didn’t find any more information on the web on how to find my recording problem.
I was running the manual test recording from my laptop which at that time was connected through VPN to the office. I decided that VPN could eventually give some networking restriction, so I tried running test recording from another machine that’s located inside the office. Not surprisingly though this machine produced the same error.
What come to surprise to me is that this time the error in Event Log on Test Controller machine was slightly different:
(QTController.exe, PID 1368, Thread 34) ControllerExecution: Exception: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.xx.xx:50086
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 Microsoft.VisualStudio.TestTools.Controller.IControllerEvents.ControllerEvent(TestMessage report)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.<>c__DisplayClass1d.<CallListeners>b__19(IControllerEvents eventListener)
at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer`1.InvokeAsRemoteUser(Action`1 invoke)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.CallListeners(TestMessage testMessage)
The IP 192.168.xx.xx is the address of where I run MTM client and after reading the cause of this error in Troubleshooting errors in lab management, everything suddenly got crystal clear to me.
The way MTM works is contacting Test Controller machine and initialize it. Then Test Controller is trying to open a socket back to the MTM recorder. You can see that by running “netstat -nab” on the MTM machine and look for something like this:
TCP 0.0.0.0:50086 0.0.0.0:0 LISTENING
[mtm.exe]
So in order to fix all errors of this kind you must make sure that your Test Controller can connect to the machine running MTM. In my case – the second error was produced because MTM machine was blocking the port because of the firewall. The first error was produced because MTM machine is a VPN client and it doesn’t get registered and resolved in DNS. In order to workaround this, I created a record to my VPN client in hosts file at Test Controller machine.
I’ve got it all running except IntelliTrace data collection which I will blog in separate post.