I have recently gotten unit/regression tests working for ArcGIS Pro 3.3. The tests seem to run fine both on an Azure pipeline and on my local machine.
However, I am having one problem- the call to the SDK method to shutdown the ArcGIS Pro process seems to hang forever and the test run never completes. This does not happen with our unit tests for ArcGIS Pro 2.9.
I followed this guide to configure the tests: https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing
Here is the code from the guide that I am using (the hang occurs at Application.Shutdown()):
/// <summary>
/// Shuts down the ArcGIS Pro Application instance
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public static void StopApplication()
{
try
{
if (Application != null)
Application.Shutdown();
}
catch (Exception e)
{
//do not re-throw the exception here.
Debug.Print("Application.Shutdown threw an exception that was ignored. message: {0}", e.Message);
}
}
Has anyone else experienced this or have any ideas on how to resolve it? For now I've just commented out that line and it works, but I'm guessing that may not be the best solution.
Thanks in advance,
Greg
Solved! Go to Solution.
So after further troubleshooting, it turns out that this was resolved by updating NuGet package dependencies.
For anyone that needs to see this, make sure that these package references for your test project are up-to-date:
So after further troubleshooting, it turns out that this was resolved by updating NuGet package dependencies.
For anyone that needs to see this, make sure that these package references for your test project are up-to-date: