microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
381 stars 243 forks source link

Error Running BC16 CU2 Tests without Timeout #1079

Closed christianurban-faveo closed 4 years ago

christianurban-faveo commented 4 years ago

Describe the issue After installing the microsoft tests with "Import-TestToolkitToBcContainer" and loading the tests in "AL Rest Runner". We start the automated tests running "Run-TestsInBCContainer" (Complete Script file is attached). After some hours we are getting the following error:

ClientSession State is TimedOut (Wait time 3 seconds) at AwaitState, C:\ProgramData\NavContainerHelper\Extensions\BC16CU2\PsTestTool-6\ClientContext.ps1: line 201 at InvokeInteraction, C:\ProgramData\NavContainerHelper\Extensions\BC16CU2\PsTestTool-6\ClientContext.ps1: line 216 at ScrollRepeater, C:\ProgramData\NavContainerHelper\Extensions\BC16CU2\PsTestTool-6\ClientContext.ps1: line 413 at Run-Tests, C:\ProgramData\NavContainerHelper\Extensions\BC16CU2\PsTestTool-6\PsTestFunctions.ps1: line 662 at , : line 57

Scripts used to create container and cause the issue

`Import-Module NavContainerHelper

$LicenseFile = "<Path>\BC16.flf"

#Create Docker Container
$DockerImage = "mcr.microsoft.com/businesscentral/onprem:16.2.13509.13779-w1"
$Username = '<user>'
$Password = '<password>'
$SecurePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
$ContainerName = "BC16CU2"

$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $Username, $SecurePassword
$SqlCredentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "sa", $SecurePassword

New-NavContainer -containerName $ContainerName -accept_eula -licenseFile $LicenseFile -imageName $DockerImage `
-auth NavUserPassword -Credential $Credentials -alwaysPull:$true -doNotExportObjectsToText:$true -updateHosts `
-accept_outdated -memoryLimit 16G -useBestContainerOS -includeAL -isolation hyperv

#Import Tests
Import-TestToolkitToBcContainer -containerName $ContainerName -sqlCredential $SqlCredentials -credential $Credentials

#Run AL Test Tool Runner in UI and load all tests
# do it via UI

#Run tests
Run-TestsInBCContainer -containerName $containerName -XUnitResultFileName "C:\ProgramData\NavContainerHelper\$ContainerName\my\results-default.xml" -testSuite "DEFAULT" -credential $Credentials -tenant 'default' -AppendToXUnitResultFile:$True -company 'CRONUS International Ltd.' -debugMode`

Full output of scripts

See attachment:
[Output.zip](https://github.com/microsoft/navcontainerhelper/files/4886500/Output.zip)

...
freddydk commented 4 years ago

I don't download and unpack .zip files - could you include them here (marked with Insert Code) thanks

christianurban-faveo commented 4 years ago

I've updated the issue. Should I also include the output with "Insert Code"? That would be (70.000 Lines)

freddydk commented 4 years ago

The recommended way of running the tests is not to load everything into the DEFAULT Test suite - but instead run Run-Tests with -extensionId for every single test app. This also means that you do not have to open the UI. We might very well have timeouts with very long running interactions - I will probably not have the time to troubleshoot that, when this is not the way to do it.

christianurban-faveo commented 4 years ago

Thanks in advance. That solves our problem. We will now run the tests per "extensionId". We did not know that this would be possible.