dsccommunity / dsccommunity/SqlServerDsc

Power BI report server Integration tests fails intermittently

Open
#2,431 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation tests
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

The integration tests for Power BI Report Server fails intermittently. Probably due to lack of resources on the Microsoft hosted-agent.

This is a list of errors where it occurs (as they become known) to see if there is something we can do about it:

Disable-SqlDscRsSecureConnection

Occurance count: 1

Can this fail during test teardown? The teardown in the test has been removed as it was not necessary. Keeping the error to see if it happens again in other places.

Running tests from 'D:\a\1\s\tests\Integration\Commands\Disable-SqlDscRsSecureConnection.Integration.Tests.ps1'
Describing Disable-SqlDscRsSecureConnection
 Context When disabling secure connection for Power BI Report Server
   [+] Should disable secure connection for PBIRS using pipeline 62.97s (62.96s|8ms)
   [+] Should return configuration when using PassThru 10.53s (10.53s|3ms)
##[error] [-] Context Disable-SqlDscRsSecureConnection.When disabling secure connection for Power BI Report Server failed
##[error]    InvalidOperationException: Failed to disable secure connection for Reporting Services instance 'PBIRS'. The remote procedure call was cancelled.  (DSRSSC0001)
##[error]    at Disable-SqlDscRsSecureConnection<Process>, D:\a\1\s\output\builtModule\SqlServerDsc\17.4.1\SqlServerDsc.psm1:13169
##[error]    at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Disable-SqlDscRsSecureConnection.Integration.Tests.ps1:184
Remove-SqlDscRSEncryptionKey

Occurance count: 1

Describing Remove-SqlDscRSEncryptionKey
 Context When removing encryption key for Power BI Report Server
VERBOSE: Removing encryption key from Reporting Services instance 'PBIRS'.
VERBOSE: Removing encryption key from Reporting Services instance 'PBIRS'. This is a destructive operation.
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''instance' = 
MSReportServer_ConfigurationSetting (InstanceName = "PBIRS"),'methodName' = DeleteEncryptionKey,'namespaceName' = 
root/Microsoft/SQLServer/ReportServer/RS_PBIRS/v15/Admin'.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''instance' = 
MSReportServer_ConfigurationSetting (InstanceName = "PBIRS"),'methodName' = DeleteEncryptionKey,'namespaceName' = 
root/Microsoft/SQLServer/ReportServer/RS_PBIRS/v15/Admin'.
##[error]    [-] Should remove the encryption key 150.13s (150.13s|5ms)
##[error]     CimException: Shutting down 
##[error]     Exception: Failed to remove encryption key from Reporting Services instance 'PBIRS'. (RSREK0001)
##[error]     at Remove-SqlDscRSEncryptionKey<Process>, D:\a\1\s\output\builtModule\SqlServerDsc\17.4.1\SqlServerDsc.psm1:27446
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Remove-SqlDscRSEncryptionKey.Integration.Tests.ps1:114
Stop-SqlDscRSWebService

Occurance count: 1

Running tests from 'D:\a\1\s\tests\Integration\Commands\Stop-SqlDscRSWebService.Integration.Tests.ps1'
Describing Stop-SqlDscRSWebService
 Context When stopping web service for Power BI Report Server
##[error]    [-] Should stop web service using pipeline 780ms (775ms|6ms)
##[error]     Expected no exception to be thrown, but an exception "Failed to stop web service for Reporting Services instance 'PBIRS'. (SRSWBS0001)" was thrown from D:\a\1\s\tests\Integration\Commands\Stop-SqlDscRSWebService.Integration.Tests.ps1:98 char:25
##[error]         + ... { $config | Stop-SqlDscRSWebService -Force -ErrorAction 'Stop' } | Sh ...
##[error]         +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
##[error]     at { $config | Stop-SqlDscRSWebService -Force -ErrorAction 'Stop' } | Should -Not -Throw, D:\a\1\s\tests\Integration\Commands\Stop-SqlDscRSWebService.Integration.Tests.ps1:98
##[error]     at Invoke-Assertion, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11391
##[error]     at Should<End>, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11334
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Stop-SqlDscRSWebService.Integration.Tests.ps1:98
Set-SqlDscRSDatabaseTimeout

Occurance count: 2

Running tests from 'D:\a\1\s\tests\Integration\Commands\Set-SqlDscRSDatabaseTimeout.Integration.Tests.ps1'
VERBOSE: Current DatabaseLogonTimeout: -1
VERBOSE: Current DatabaseQueryTimeout: 300
Describing Set-SqlDscRSDatabaseTimeout
 Context When setting database timeout for Power BI Report Server
   [+] Should not throw when setting LogonTimeout 5.13s (5.12s|6ms)
   [+] Should not throw when setting QueryTimeout 5.14s (5.13s|2ms)
##[error]    [-] Should not throw when setting both LogonTimeout and QueryTimeout 2.22s (2.22s|2ms)
##[error]     CimException: Shutting down 
##[error]     Exception: Failed to set database logon timeout for Reporting Services instance 'PBIRS'. (SSRSDT0001)
##[error]     at Set-SqlDscRSDatabaseTimeout<Process>, D:\a\1\s\output\builtModule\SqlServerDsc\17.4.1\SqlServerDsc.psm1:33787
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Set-SqlDscRSDatabaseTimeout.Integration.Tests.ps1:140

Occurance count: 1

Running tests from 'D:\a\1\s\tests\Integration\Commands\Set-SqlDscRSDatabaseTimeout.Integration.Tests.ps1'
VERBOSE: Current DatabaseLogonTimeout: -1
VERBOSE: Current DatabaseQueryTimeout: 300
Describing Set-SqlDscRSDatabaseTimeout
 Context When setting database timeout for Power BI Report Server
   [+] Should not throw when setting LogonTimeout 5.13s (5.13s|4ms)
##[error]    [-] Should not throw when setting QueryTimeout 789ms (786ms|3ms)
##[error]     CimException: Shutting down 
Initialize-SqlDscRS

Occurance count: 1

Running tests from 'D:\a\1\s\tests\Integration\Commands\Initialize-SqlDscRS.Integration.Tests.ps1'
Describing Initialize-SqlDscRS
 Context When initializing Power BI Report Server
##[error]    [-] Should return initialization status 497ms (21ms|476ms)
##[error]     Expected the value to have type [bool] or any of its subtypes, but got $null with type $null.
##[error]     at $script:isInitialized | Should -BeOfType [System.Boolean], D:\a\1\s\tests\Integration\Commands\Initialize-SqlDscRS.Integration.Tests.ps1:139

Occurance count: 1


Running tests from 'D:\a\1\s\tests\Integration\Commands\Initialize-SqlDscRS.Integration.Tests.ps1'
Describing Initialize-SqlDscRS
 Context When initializing Power BI Report Server
   [+] Should return initialization status 175ms (4ms|170ms)
##[error]    [-] Should initialize or return already initialized 229ms (226ms|3ms)
##[error]     CimException: The remote procedure call was cancelled. 
##[error]     Exception: Failed to initialize the Reporting Services instance 'PBIRS'. (ISRS0001)
##[error]     at Initialize-SqlDscRS<Process>, D:\a\1\s\output\builtModule\SqlServerDsc\17.5.0\SqlServerDsc.psm1:20516
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Initialize-SqlDscRS.Integration.Tests.ps1:143

Occurance count: 1

Running tests from 'D:\a\1\s\tests\Integration\Commands\Initialize-SqlDscRS.Integration.Tests.ps1'
Describing Initialize-SqlDscRS
 Context When initializing Power BI Report Server
   [+] Should return initialization status 640ms (16ms|625ms)
##[error]    [-] Should initialize or return already initialized 60.9s (60.9s|3ms)
##[error]     WriteErrorException: Method InitializeReportServer() failed after all attempts. Errors: Attempt 1: HRESULT: -2147023181, Error: No error details were returned by the method. See HRESULT code for more information. (IRCM0002) (IRCM0003) (IRCM0004) (IRCM0001)
##[error]     Exception: Failed to initialize the Reporting Services instance 'PBIRS'. (ISRS0001)
##[error]     at Initialize-SqlDscRS<Process>, D:\a\1\s\output\builtModule\SqlServerDsc\17.5.0\SqlServerDsc.psm1:20337
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Initialize-SqlDscRS.Integration.Tests.ps1:143
Start-SqlDscRSWebService

Occurance count: 2

Running tests from 'D:\a\1\s\tests\Integration\Commands\Start-SqlDscRSWebService.Integration.Tests.ps1'
Describing Start-SqlDscRSWebService
 Context When starting web service for Power BI Report Server
##[error]    [-] Should start web service using pipeline 3.51s (3.51s|5ms)
##[error]     Expected no exception to be thrown, but an exception "Failed to start web service for Reporting Services instance 'PBIRS'. (SSRSWBS0001)" was thrown from D:\a\1\s\tests\Integration\Commands\Start-SqlDscRSWebService.Integration.Tests.ps1:98 char:25
##[error]         + ... { $config | Start-SqlDscRSWebService -Force -ErrorAction 'Stop' } | S ...
##[error]         +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
##[error]     at { $config | Start-SqlDscRSWebService -Force -ErrorAction 'Stop' } | Should -Not -Throw, D:\a\1\s\tests\Integration\Commands\Start-SqlDscRSWebService.Integration.Tests.ps1:98
##[error]     at Invoke-Assertion, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11391
##[error]     at Should<End>, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11334
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Start-SqlDscRSWebService.Integration.Tests.ps1:98
Test-SqlDscRSInitialized

Occurance count: 3

Running tests from 'D:\a\1\s\tests\Integration\Commands\Test-SqlDscRSInitialized.Integration.Tests.ps1'
Describing Test-SqlDscRSInitialized
 Context When testing if Power BI Report Server is initialized
##[error]    [-] Should return initialization status 20.4s (20.4s|7ms)
##[error]     Expected the value to have type [bool] or any of its subtypes, but got $null with type $null.
##[error]     at $result | Should -BeOfType [System.Boolean], D:\a\1\s\tests\Integration\Commands\Test-SqlDscRSInitialized.Integration.Tests.ps1:63
##[error]     at Invoke-Assertion, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11391
##[error]     at Should<End>, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11334
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Test-SqlDscRSInitialized.Integration.Tests.ps1:63

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the named tests/Integration/Commands files for the Power BI Report Server commands and review their setup, teardown, and failure locations. Compare the intermittent RPC, CIM, and null-result errors against the Microsoft hosted-agent context and the listed occurrence counts. Done means the cause is identified and the affected integration tests have a clear, repeatable reliability improvement.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
ci-cd, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.