pvandervelde / Sherlock

Sherlock provides a means to schedule and automatically execute tests in an controlled virtual machine environment.
http://pvandervelde.github.io/Sherlock
Apache License 2.0
2 stars 0 forks source link

Errors in Sherlock.Service.Master log due to VM terminating shortly before / during State check. #12

Open pvandervelde opened 11 years ago

pvandervelde commented 11 years ago

From the Sherlock.Service.Master log. Just after a test completed and the VM was terminated.

2013/10/31T19:46:10.17343 +13:00 - Debug: Sherlock.Shared.Plugins-HyperV - Hyper-V virtual machine VM-TL-Win7-Pro-01 terminated 2013/10/31T19:46:10.51053 +13:00 - Trace: Communication - Invoking System.Threading.Tasks.Task`1[Sherlock.Shared.Core.TestExecutionState] State()

This was followed by this error message: 2013/10/31T19:46:40.82533 +13:00 - Error: Sherlock.Service.Master - Failed to contact environment [Win7-Pro-01]. An exception was thrown: System.AggregateException: One or more errors occurred. ---> Nuclei.Communication.CommandInvocationFailedException: The invocation of a command failed. ---> Nuclei.Communication.EndpointNotContactableException: The endpoint [VM-TL-WIN7-PRO:2716] cannot be contacted. No connection information for this endpoint is available. at Lokad.Enforce.With[TException](Boolean check, String message, Object[] args) at Nuclei.Communication.CommunicationLayer.SendMessageAndWaitForResponse(EndpointId endpoint, ICommunicationMessage message) at Nuclei.Communication.CommunicationModule.SendMessageWithResponse(IConfiguration configuration, ISendDataViaChannels layer, EndpointId endpoint, ICommunicationMessage message) at Nuclei.Communication.CommunicationModule.<>cDisplayClass86.b83(EndpointId endpoint, ICommunicationMessage msg) at Nuclei.Communication.CommandProxyBuilder.<>cDisplayClassf.bc(ISerializedMethodInvocation methodInvocation) at Nuclei.Communication.CommandSetMethodWithResultInterceptor.Intercept(IInvocation invocation) --- End of inner exception stack trace --- at Nuclei.Communication.CommandSetMethodWithResultInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.IExecuteTestStepsCommandsProxy.State() at Sherlock.Service.Master.ActiveMachineEnvironment.<>cDisplayClassd.bc() in e:\documents\Petrik\documents\software\Sherlock\src\service.master\ActiveMachineEnvironment.cs:line 158 at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- ---> (Inner Exception #0) Nuclei.Communication.CommandInvocationFailedException: The invocation of a command failed. ---> Nuclei.Communication.EndpointNotContactableException: The endpoint [VM-TL-WIN7-PRO:2716] cannot be contacted. No connection information for this endpoint is available. at Lokad.Enforce.With[TException](Boolean check, String message, Object[] args) at Nuclei.Communication.CommunicationLayer.SendMessageAndWaitForResponse(EndpointId endpoint, ICommunicationMessage message) at Nuclei.Communication.CommunicationModule.SendMessageWithResponse(IConfiguration configuration, ISendDataViaChannels layer, EndpointId endpoint, ICommunicationMessage message) at Nuclei.Communication.CommunicationModule.<>c__DisplayClass86.<RegisterCommandHub>b__83(EndpointId endpoint, ICommunicationMessage msg) at Nuclei.Communication.CommandProxyBuilder.<>c__DisplayClassf.<ProxyConnectingTo>b__c(ISerializedMethodInvocation methodInvocation) at Nuclei.Communication.CommandSetMethodWithResultInterceptor.Intercept(IInvocation invocation) --- End of inner exception stack trace --- at Nuclei.Communication.CommandSetMethodWithResultInterceptor.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.IExecuteTestStepsCommandsProxy.State() at Sherlock.Service.Master.ActiveMachineEnvironment.<>c__DisplayClassd.<State>b__c() in e:\documents\Petrik\documents\software\Sherlock\src\service.master\ActiveMachineEnvironment.cs:line 158 at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute()<---

pvandervelde commented 10 years ago

The main problem seems to be in the fact that we don't check in the ActiveMachineEnvironment.State() if the IExecuteTestStepsCommands is still a valid reference and so we call it after (or during) the disconnection of the communication system.