Bug 58688 - Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to shut down existing DeviceAgent service
Summary: Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to shut down exis...
Status: RESOLVED DOWNSTREAM
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-10 06:54 UTC by Dávid Kaya
Modified: 2017-08-10 16:38 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DOWNSTREAM

Description Dávid Kaya 2017-08-10 06:54:40 UTC
Hello,

I get following error in some test scenarios. However it is not always the same test scenario, it is really non-deterministic.

iOS Simulator 10.3.1
macOS 10.12
Xamarin SDKs all updated to last version
Xamarin.TestCloud.Agent version 0.20.6
Xamarin.UITest version 2.0.9.1637

09-Aug-2017 22:12:10	1) Error : RegressionTests.Features.PrintJobDetailFeature(iOS).UserTriesToChangeTheSideFinishingOptionOfAPrintJob
09-Aug-2017 22:12:10	Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to shut down existing DeviceAgent service
09-Aug-2017 22:12:10	TearDown : System.InvalidOperationException : No process is associated with this object.
09-Aug-2017 22:12:10	  at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<ShutdownAsync>c__asyncB.MoveNext () [0x003be] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	--- End of stack trace from previous location where exception was thrown ---
09-Aug-2017 22:12:10	  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	  at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<LaunchTestAsync>c__async6.MoveNext () [0x0029b] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	--- End of stack trace from previous location where exception was thrown ---
09-Aug-2017 22:12:10	  at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x0020a] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	  at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x0007a] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	  at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Execution.IExecutor executor) [0x002de] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	  at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00000] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	  at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <fa598dbf7e4f4135a0540da575019504>:0 
09-Aug-2017 22:12:10	  at RegressionTests.AppInitializer.ConfigureiOSApp () [0x00036] in <f1dd7b605ed1407e97c69f92514611da>:0 
09-Aug-2017 22:12:10	  at RegressionTests.AppInitializer.StartApp (Xamarin.UITest.Platform platform) [0x00009] in <f1dd7b605ed1407e97c69f92514611da>:0 
09-Aug-2017 22:12:10	  at RegressionTests.Features.FeatureBase.BeforeEachTest () [0x00000] in <f1dd7b605ed1407e97c69f92514611da>:0 
09-Aug-2017 22:12:10	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
09-Aug-2017 22:12:10	  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	--TearDown
09-Aug-2017 22:12:10	  at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x00018] in <5afdc70d980c4033b3878286f754d091>:0 
09-Aug-2017 22:12:10	  at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x0002b] in <5afdc70d980c4033b3878286f754d091>:0 
09-Aug-2017 22:12:10	  at System.Diagnostics.Process.GetProcessHandle (System.Int32 access, System.Boolean throwIfExited) [0x00077] in <5afdc70d980c4033b3878286f754d091>:0 
09-Aug-2017 22:12:10	  at System.Diagnostics.Process.GetProcessHandle (System.Int32 access) [0x00000] in <5afdc70d980c4033b3878286f754d091>:0 
09-Aug-2017 22:12:10	  at System.Diagnostics.Process.Kill () [0x00002] in <5afdc70d980c4033b3878286f754d091>:0 
09-Aug-2017 22:12:10	  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Kill ()
09-Aug-2017 22:12:10	  at TrafficSniffer.Traffic.Dispose () [0x00000] in <cfc96c8680f84642b08892d2f806824a>:0 
09-Aug-2017 22:12:10	  at RegressionTests.Features.FeatureBase.TestFixtureTearDown () [0x0000a] in <f1dd7b605ed1407e97c69f92514611da>:0 
09-Aug-2017 22:12:10	  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
09-Aug-2017 22:12:10	  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <ffb99659fc1c47faa4d5f883014d08aa>:0 
09-Aug-2017 22:12:10	

Any idea where is the problem?

Thanks,

David
Comment 1 John Miller [MSFT] 2017-08-10 16:38:29 UTC
Hi David,

Thanks for reporting this issue. It looks like this could be related to UITest instead of Xamarin.iOS. I would suggest using the Support link at the top of https://testcloud.xamarin.com/login to report this issue and work with the team there to get them the information they need to file an issue. There also was a new version of UITest released today that would be good to confirm with: 2.0.10. I'll resolve this issue as downstream as it's not identifiable as an issue in Xamarin.iOS but instead UITest. 

Thank you!