<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Regression Test does not shutdown application properly in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/regression-test-does-not-shutdown-application/m-p/1307297#M10027</link>
    <description>&lt;P&gt;I have migrated the regression test example from our previous Arcgis Pro 2.9 to 3.1&lt;/P&gt;&lt;P&gt;After testing I noticed that the whole Test procedure keeps running (even all tests are already completed).&lt;/P&gt;&lt;P&gt;Reason for this is line 6 of the below snipped in `TestEnvironment.cs` and causes our DevOps operations to become freezed&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;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);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;I workaround this by gracefully kill the testhost.exe process as following&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static void StopApplication()
        {
            try
            {
                if (Application != null)
                {
                    var proc = Process.GetCurrentProcess();
                    proc.CloseMainWindow();
                    // below might hang after all tests succeeded
                    //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);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;Luckily the results are not affected after killing the process that way.&lt;/P&gt;&lt;P&gt;Also, there are no project edits or pending save operations.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jul 2023 15:10:19 GMT</pubDate>
    <dc:creator>ole1986</dc:creator>
    <dc:date>2023-07-11T15:10:19Z</dc:date>
    <item>
      <title>Regression Test does not shutdown application properly</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/regression-test-does-not-shutdown-application/m-p/1307297#M10027</link>
      <description>&lt;P&gt;I have migrated the regression test example from our previous Arcgis Pro 2.9 to 3.1&lt;/P&gt;&lt;P&gt;After testing I noticed that the whole Test procedure keeps running (even all tests are already completed).&lt;/P&gt;&lt;P&gt;Reason for this is line 6 of the below snipped in `TestEnvironment.cs` and causes our DevOps operations to become freezed&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;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);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;I workaround this by gracefully kill the testhost.exe process as following&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static void StopApplication()
        {
            try
            {
                if (Application != null)
                {
                    var proc = Process.GetCurrentProcess();
                    proc.CloseMainWindow();
                    // below might hang after all tests succeeded
                    //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);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;Luckily the results are not affected after killing the process that way.&lt;/P&gt;&lt;P&gt;Also, there are no project edits or pending save operations.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 15:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/regression-test-does-not-shutdown-application/m-p/1307297#M10027</guid>
      <dc:creator>ole1986</dc:creator>
      <dc:date>2023-07-11T15:10:19Z</dc:date>
    </item>
  </channel>
</rss>

