Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Running BCPT Tests fail with "Could not open the client session" #1240

Open
Krajzys opened this issue Oct 7, 2024 · 3 comments
Open
Labels
bug Something isn't working Under Investigation Issue is under investigation

Comments

@Krajzys
Copy link

Krajzys commented Oct 7, 2024

AL-Go version

4.1

Describe the issue

When a pipeline is ran and it proceeds to the Running BCPT tests step, it fails with Unexpected error: Error Message: Could not open the client session. Check if the web server is running and you can log in.
Seems to be an issue with BC 25, since in BC 24 it passed without errors.

Expected behavior

The BCPT tests should be ran without error since they also run without errors on local development environment.

Steps to reproduce

I reproduced it on a local enviroment:

  1. Setup a clean 25.0 sandbox container with country NL
  2. Install performance toolkit
  3. Create a new BCPT Suite inside Business Central
  4. Run the BCPT tests from powershell using Run-BCPTTestsInBcContainer, and supplying containerName, tenant, companyName, suiteCode, testPage (I used 149002 as in pipelines) and credentials
  5. The run will fail with Could not open the client session

Additional context (logs, screenshots, etc.)

2024-10-04T12:09:28.0990941Z ##[group]Running BCPT tests
2024-10-04T12:09:28.0991310Z   _____                   _               ____   _____ _____ _______   _            _
2024-10-04T12:09:28.0991788Z  |  __ \                 (_)             |  _ \ / ____|  __ \__   __| | |          | |
2024-10-04T12:09:28.0992295Z  | |__) |   _ _ __  _ __  _ _ __   __ _  | |_) | |    | |__) | | |    | |_ ___  ___| |_ ___
2024-10-04T12:09:28.1065946Z  |  _  / | | | '_ \| '_ \| | '_ \ / _` | |  _ <| |    |  ___/  | |    | __/ _ \/ __| __/ __|
2024-10-04T12:09:28.1066735Z  | | \ \ |_| | | | | | | | | | | | (_| | | |_) | |____| |      | |    | ||  __/\__ \ |_\__ \
2024-10-04T12:09:28.1067560Z  |_|  \_\__,_|_| |_|_| |_|_|_| |_|\__, | |____/ \_____|_|      |_|     \__\___||___/\__|___/
2024-10-04T12:09:28.1068247Z                                    __/ |
2024-10-04T12:09:28.1075460Z                                   |___/
2024-10-04T12:09:29.5216163Z Using CompanyName CRONUS NL
2024-10-04T12:09:30.0638651Z Invoke GET on http://172.19.92.21:7048/BC/api/v1.0/companies?$filter=name%20eq%20'CRONUS%20NL'&tenant=default
2024-10-04T12:09:33.7021425Z Using Company ID 88ad7781-1982-ef11-ac2a-6045bdaca39f
2024-10-04T12:09:34.8422863Z Invoke POST on http://172.19.92.21:7048/BC/api/Microsoft/PerformancToolkit/v1.0/companies(88ad7781-1982-ef11-ac2a-6045bdaca39f)/bcptSuites?tenant=default
2024-10-04T12:09:35.7960671Z Using testpage 149002
2024-10-04T12:09:35.7967395Z Using Suitecode VOSPERF
2024-10-04T12:09:35.7976112Z Service Url http://bc11179343357/BC/cs/?tenant=default&company=CRONUS%20NL
2024-10-04T12:09:35.7984286Z Running Performance Tests for 3 minutes...
2024-10-04T12:11:07.0453003Z Running performance test failed
2024-10-04T12:11:07.0461426Z The passed path for -BCPTTestRunnerInternalFolderPath seem to be relative path, converting to absolute.
2024-10-04T12:11:07.0463206Z Absolute path is C:\ProgramData\BcContainerHelper\extensions\bc11179343357\my\TestRunner\Internal
2024-10-04T12:11:07.0470099Z Importing AL Test Runner from C:\ProgramData\BcContainerHelper\extensions\bc11179343357\my\TestRunner\Internal\BCPTTestRunnerInternal.psm1
2024-10-04T12:11:07.0475100Z WARNING: The names of some imported commands from the module 'ALTestRunnerInternal' include unapproved verbs that might
2024-10-04T12:11:07.0477114Z  make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the 
2024-10-04T12:11:07.0481710Z Verbose parameter. For a list of approved verbs, type Get-Verb.
2024-10-04T12:11:07.0482543Z Installing MSAL.PS...
2024-10-04T12:11:08.0327575Z ##[group]Removing container
2024-10-04T12:11:08.0328269Z Get Event Log from container
2024-10-04T12:11:08.0332189Z Getting event log for bc11179343357
2024-10-04T12:11:09.9472039Z Removing Session bc11179343357
2024-10-04T12:11:09.9941959Z Removing container bc11179343357
2024-10-04T12:11:11.5568627Z Removing entries from hosts
2024-10-04T12:11:11.5819070Z Removing bc11179343357 from container hosts file
2024-10-04T12:11:11.6547503Z Removing bc11179343357-* from container hosts file
2024-10-04T12:11:11.6661501Z Removing Desktop shortcuts
2024-10-04T12:11:11.7670888Z Removing C:\ProgramData\BcContainerHelper\Extensions\bc11179343357
2024-10-04T12:11:12.4892105Z ##[endgroup]
2024-10-04T12:11:12.9482162Z Run-AlPipeline Telemetry Correlation Id: 1d88492a-7d59-4bff-bcc6-d3fb90d0c479
2024-10-04T12:11:13.2291544Z AL-Go action ran: RunPipeline Telemetry Correlation Id: 5859f0cc-1d8b-451b-a45e-189d4c576639
2024-10-04T12:11:13.3031589Z ##[error]Unexpected error when running action. Error Message: Could not open the client session. Check if the web server is running and you can log in. Last error: ClientSession is Uninitialized, StackTrace: at Open-ClientSessionWithWait, C:\ProgramData\BcContainerHelper\extensions\bc11179343357\my\TestRunner\Internal\ALTestRunnerInternal.psm1: line 382 <- at Get-NoOfIterations, C:\ProgramData\BcContainerHelper\extensions\bc11179343357\my\TestRunner\Internal\BCPTTestRunnerInternal.psm1: line 282 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\extensions\bc11179343357\my\TestRunner\RunBCPTTests.ps1: line 253
2024-10-04T12:11:13.4544702Z ##[error]Process completed with exit code 1.
@Krajzys Krajzys added the bug Something isn't working label Oct 7, 2024
@BB97GER
Copy link

BB97GER commented Oct 8, 2024

I can confirm this behaviour:

  • clean 25.0 sandbox container with country DE
  • BcContainerHelper version 6.0.25 and 6.0.26-preview1245
  • Al-Go version 5.3 and 6.0
2024-10-08T06:55:46.9810898Z ##[group]Running BCPT tests
2024-10-08T06:55:46.9816780Z   _____                   _               ____   _____ _____ _______   _            _
2024-10-08T06:55:46.9817195Z  |  __ \                 (_)             |  _ \ / ____|  __ \__   __| | |          | |
2024-10-08T06:55:46.9817607Z  | |__) |   _ _ __  _ __  _ _ __   __ _  | |_) | |    | |__) | | |    | |_ ___  ___| |_ ___
2024-10-08T06:55:46.9818200Z  |  _  / | | | '_ \| '_ \| | '_ \ / _` | |  _ <| |    |  ___/  | |    | __/ _ \/ __| __/ __|
2024-10-08T06:55:46.9822438Z  | | \ \ |_| | | | | | | | | | | | (_| | | |_) | |____| |      | |    | ||  __/\__ \ |_\__ \
2024-10-08T06:55:46.9823204Z  |_|  \_\__,_|_| |_|_| |_|_|_| |_|\__, | |____/ \_____|_|      |_|     \__\___||___/\__|___/
2024-10-08T06:55:46.9823717Z                                    __/ |
2024-10-08T06:55:46.9824187Z                                   |___/
2024-10-08T06:56:14.6344471Z Using CompanyName CRONUS DE
2024-10-08T06:56:42.7246561Z Invoke GET on http://172.25.148.229:7048/BC/api/v1.0/companies?$filter=name%20eq%20%27CRONUS%20DE%27&tenant=default
2024-10-08T06:56:46.7357679Z Using Company ID ea0971bd-c984-ef11-ac2c-6045bde98868
2024-10-08T06:57:14.7590954Z Invoke POST on http://172.25.148.229:7048/BC/api/Microsoft/PerformancToolkit/v1.0/companies(ea0971bd-c984-ef11-ac2c-6045bde98868)/bcptSuites?tenant=default
2024-10-08T06:57:42.6515533Z Using testpage 149002
2024-10-08T06:57:42.6528863Z Using Suitecode 10UserTest
2024-10-08T06:57:42.6534795Z Service Url http://bc11229847976/BC/cs/?tenant=default&company=CRONUS%20DE
2024-10-08T06:57:42.6539169Z Running Performance Tests for 5 minutes...
2024-10-08T06:58:09.2556516Z Running performance test failed
2024-10-08T06:58:09.2588231Z The passed path for -BCPTTestRunnerInternalFolderPath seem to be relative path, converting to absolute.
2024-10-08T06:58:09.2597808Z Absolute path is C:\ProgramData\BcContainerHelper\Extensions\bc11229847976\my\TestRunner\Internal
2024-10-08T06:58:09.2604568Z Importing AL Test Runner from C:\ProgramData\BcContainerHelper\Extensions\bc11229847976\my\TestRunner\Internal\BCPTTestRunnerInternal.psm1
2024-10-08T06:58:09.2647358Z �[33;1mWARNING: The names of some imported commands from the module 'ALTestRunnerInternal' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.�[0m
2024-10-08T06:58:09.2689221Z ##[group]Removing container
2024-10-08T06:58:09.2792738Z Get Event Log from container
2024-10-08T06:58:09.2894049Z Getting event log for bc11229847976
2024-10-08T06:58:24.0852742Z Removing Session bc11229847976
2024-10-08T06:58:24.1788520Z Removing container bc11229847976
2024-10-08T06:58:26.4486592Z Removing entries from hosts
2024-10-08T06:58:26.4843824Z Removing bc11229847976 from container hosts file
2024-10-08T06:58:26.5373761Z Removing bc11229847976-* from container hosts file
2024-10-08T06:58:26.5423798Z Removing Desktop shortcuts
2024-10-08T06:58:26.5792809Z Removing C:\ProgramData\BcContainerHelper\Extensions\bc11229847976
2024-10-08T06:58:29.0725625Z ##[endgroup]
2024-10-08T06:58:29.7756219Z Run-AlPipeline Telemetry Correlation Id: f334420c-409d-43e3-b6e7-861d23bbcc2f
2024-10-08T06:58:30.2628589Z Applying settings from C:\actions-runner\_work\LearnLabAL\LearnLabAL\.github\AL-Go-Settings.json
2024-10-08T06:58:30.2671648Z Applying settings from C:\actions-runner\_work\LearnLabAL\LearnLabAL\.AL-Go\settings.json
2024-10-08T06:58:30.2706027Z No settings found in C:\actions-runner\_work\LearnLabAL\LearnLabAL\.github\CICD.settings.json
2024-10-08T06:58:30.2723491Z No settings found in C:\actions-runner\_work\LearnLabAL\LearnLabAL\.AL-Go\CICD.settings.json
2024-10-08T06:58:30.2732297Z No settings found in C:\actions-runner\_work\LearnLabAL\LearnLabAL\.AL-Go\BB97GER.settings.json
2024-10-08T06:58:30.3387298Z Enabling Microsoft telemetry...
2024-10-08T06:58:30.6306901Z ##[error]Unexpected error when running action. Error Message: Could not open the client session. Check if the web server is running and you can log in. Last error: ClientSession is Uninitialized, StackTrace: at Open-ClientSessionWithWait, C:\ProgramData\BcContainerHelper\Extensions\bc11229847976\my\TestRunner\Internal\ALTestRunnerInternal.psm1: line 382 <- at Get-NoOfIterations, C:\ProgramData\BcContainerHelper\Extensions\bc11229847976\my\TestRunner\Internal\BCPTTestRunnerInternal.psm1: line 282 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\Extensions\bc11229847976\my\TestRunner\RunBCPTTests.ps1: line 253
2024-10-08T06:58:30.9070519Z ##[error]Process completed with exit code 1.

@freddydk
Copy link
Contributor

freddydk commented Oct 8, 2024

I have a repro of this problem, will investigate

@freddydk freddydk added the Under Investigation Issue is under investigation label Oct 8, 2024
@freddydk
Copy link
Contributor

freddydk commented Oct 8, 2024

Looks like this is a problem in BC - not something we can fix in AL-Go or BcContainerHelper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Under Investigation Issue is under investigation
Projects
None yet
Development

No branches or pull requests

3 participants