Select to view content in your preferred language

ArcGIS Pro 3.3 Regression/Unit Tests not running

372
7
05-14-2024 03:52 AM
marco_vertigis
New Contributor III

Hi there,

I am currently try to run some integration/unit tests with the headless pro instance.

I followed the steps described in the guide (https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing) and even tried to replicate the exact same sample, without any success. I also tried to use the Extension30 nuget instead of the dlls directly (https://community.esri.com/t5/arcgis-pro-sdk-questions/any-suggestion-on-setting-up-unit-test-projec...)

 

The start up process of the headless test client always throws a null pointer exception:

Object reference not set to an instance of an object.

The stack trace implies that it has something to do with the licensing

   at ArcGIS.Desktop.Core.Licensing.LicensedApplication.<CheckForLicenseAsync>d__12.MoveNext()
   at ArcGIS.Desktop.Core.ProApp.<TestModeInitialize>d__15.MoveNext()
   at GetSymbolSwatchTests.TestEnvironment.<StartApplication>d__2.MoveNext() in C:\Daten\repos\sandbox\GetSymbolWatchTests\TestEnvironment.cs:line 68

I got an ArcGIS Pro 3.3 installation on my host with a valid concurrent use license fetched from a server. Are there any requirements to the licensing level? I also completely reinstalled the ArcGIS Pro installation without any effect. The sample project which I used is attached (sandbox.zip).

Any help would be appreciated!

0 Kudos
7 Replies
DanNarsavage_IDWR
New Contributor III

I was about to post about a very similar situation with the following differences:

  • I'm stuck at version 3.2.2, and
  • I've got an advanced named user license authorized to work offline.

I get the very same stack trace as OP when running any test that uses any classes in the ArcGIS SDK, but these tests work as intended for the person who created them (using the same guidance doc).  That person's environment is identical to mine (as far as either of us knows) except I'm running Windows 10 and he's running Windows 11.

marco_vertigis
New Contributor III

I did the same test with a colleague and the exact same unit test project seems to run with his Windows 11 installation. So I guess the Windows version matters?! I wonder if ESRI just tested this on Windows 11 clients..

Thanks for the hint, appreciate it!

DanNarsavage_IDWR
New Contributor III

I've tried our tests on a Win11 machine without success. The errors are different, but still related to spinning up Esri classes.  That led me to rule out the OS being the issue, but your experience makes it clear that it's at least a contributing factor.  Thanks!

0 Kudos
marco_vertigis
New Contributor III

I did some further testing. I changed my Concurrent license to a Single Use license without any effect. After digging a bit deeper to find the cause. I get a weird error popup when initializing the 'ProApp' object, see image below:

marco_vertigis_0-1715845047032.png

Afer that I get various null pointer exceptions while instantiating the ProApp object at:

   at ArcGIS.Desktop.Internal.Core.SignOn.SetSignOnDlgCallback() in ArcGIS.Desktop.Internal.Core\SignOn.cs:line 77
   at ArcGIS.Desktop.Internal.Core.LicenseManager.InitProLicense() in ArcGIS.Desktop.Internal.Core\LicenseManager.cs:line 355
   at ArcGIS.Desktop.Internal.Core.LicenseManager.CreateLicenseManager(Progressor progressor) in ArcGIS.Desktop.Internal.Core\LicenseManager.cs:line 191
   at ArcGIS.Desktop.Internal.Core.LicenseManager.GetFulfillmentSource() in ArcGIS.Desktop.Internal.Core\LicenseManager.cs:line 547

And finally:

   at ArcGIS.Desktop.Core.Licensing.LicensedApplication.<CheckForLicenseAsync>d__12.MoveNext() in ArcGIS.Desktop.Core.Licensing\LicensedApplication.cs:line 67

 

The cause of all these null pointer seems to be the 'LicensingService' to be null after initializing the test mode. Unfortunately I am unable to debug this further and need some help here.

ArcGIS.Desktop.Internal.Core.LicenseManager.LicensingService

 

0 Kudos
DanNarsavage_IDWR
New Contributor III

Nice sleuthing! I've pivoted toward abandoning my Win10 machine in favor of a Win11 laptop so (once I figure out a few more issues with the tests) I should be able to continue development.  Our CI server is on an older server so I anticipate the same issues there (once I get the licensing for such a server figured out) so I'm still quite interested in this thread and I'll put any new pertinent observations here as well.

0 Kudos
SrinivasVinnakota
Esri Contributor

Could you try adding C:\Program Files\ArcGIS\Pro\bin to your system's PATH environment variable and also make sure this is the very first entry in PATH.  Then restart Visual Studio and try executing any test

PS: Do not add it to User PATH environment variable, select System PATH

0 Kudos
marco_vertigis
New Contributor III

Already tried this, no effect at all.

0 Kudos