Closed
Description
Prerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
- I have read the troubleshooting guide.
- I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
- If this is a security issue, I have read the security issue reporting guidance.
Summary
Since upgrading the PowerShell extension to 2022.5.1, some Pester tests in a few projects are failing with this error and if there are more than 5 test cases:
[-] DSCFile01 has a valid Configurations Setting (!$null) 60ms (56ms|4ms)
ScriptCallDepthException: The script failed due to call depth overflow.
RuntimeException: The script failed due to call depth overflow.
I don't see any recursive calls in the Pester code.
This only fails in the PowerShell Integrated Console
and works fine in the console just named 'powershell`.
I have tried to narrow it down a bit. If I lower the number if test cases to 5 in .\tests\ConfigData\CompositeResources.Tests.ps1::67
($testCases[0..4
), the tests pass. If I add one ($testCases[0..5]
), I get a ScriptCallDepthException
.
If I downgrade to the PowerShell extension version 2021.12.0, things run regardless how many test cases I have.
@nohwnd, have you seen something similar by any chance?
PowerShell Version
Name Value
---- -----
PSVersion 5.1.22000.613
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.613
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visual Studio Code Version
1.67.0
57fd6d0195bb9b9d1b49f6da5db789060795de47
x64
Extension Version
ms-vscode.powershell@2022.5.1
Steps to Reproduce
In a VSCode terminal:
git clone https://github.com/dsccommunity/DscWorkshop.git d:\DscWorkshop
cd D:\DscWorkshop\
git checkout test/InsufficientExecutionStackException
.\build.ps1 -ResolveDependency
Visuals
NA
Logs
PS D:\Git\DscWorkshop> .\build.ps1
[pre-build] Starting Build Init
[pre-build] Pre-pending 'D:\Git\DscWorkshop\output\RequiredModules' folder to PSModulePath
[build] Starting build with InvokeBuild.
[build] Parsing defined tasks
[build] Loading Configuration from D:\Git\DscWorkshop\build.yaml
[build] Pre-pending 'D:\Git\DscWorkshop\output\AvoidPSPathOverlap' folder to PSModulePath
Importing tasks from module Sampler
Loading Build-Module.ModuleBuilder.build.Sampler.ib.tasks...
Loading ChocolateyPackage.build.Sampler.ib.tasks...
Loading Clean.ModuleBuilder.build.Sampler.ib.tasks...
Loading DeployAll.PSDeploy.build.Sampler.ib.tasks...
Loading DscResource.Test.build.Sampler.ib.tasks...
Loading generateHelp.PlatyPS.build.Sampler.ib.tasks...
Loading GuestConfig.build.Sampler.ib.tasks...
Loading Invoke-Pester.pester.build.Sampler.ib.tasks...
Loading JaCoCo.coverage.build.Sampler.ib.tasks...
Loading release.module.build.Sampler.ib.tasks...
Loading Set-BuildEnvironment.BuildHelpers.build.Sampler.ib.tasks...
Loading Set-SamplerTaskVariable...
Importing tasks from module Sampler.DscPipeline
Loading CompileDatumRsop.build.Sampler.DscPipeline.ib.tasks...
Loading CompileRootConfiguration.build.Sampler.DscPipeline.ib.tasks...
Loading CompileRootMetaMof.build.Sampler.DscPipeline.ib.tasks...
Loading CompressArtifactCollections.build.Sampler.DscPipeline.ib.tasks...
Loading CompressModulesWithChecksum.build.Sampler.DscPipeline.ib.tasks...
Loading LoadDatumConfigData.build.Sampler.DscPipeline.ib.tasks...
Loading NewMofChecksums.build.Sampler.DscPipeline.ib.tasks...
Loading TestBuildAcceptance.build.Sampler.DscPipeline.ib.tasks...
Loading TestConfigData.build.Sampler.DscPipeline.ib.tasks...
Loading TestDscResources.build.Sampler.DscPipeline.ib.tasks...
Adding Workflow from configuration:
+-> pack
+-> init
+-> build
+-> .
[build] Executing requested workflow: .
Build . D:\Git\DscWorkshop\build.ps1
Redefined task '.'.
===============================================================================
INIT
-------------------------------------------------------------------------------
/./build/Init
D:\Git\DscWorkshop\build.ps1:331
Done /./build/Init 00:00:00.0389991
===============================================================================
CLEAN
Deleting the content of the Build Output folder, except ./modules
-------------------------------------------------------------------------------
/./build/Clean
D:\Git\DscWorkshop\output\RequiredModules\Sampler\0.112.3\tasks\Clean.ModuleBuilder.build.ps1:16
Removing D:\Git\DscWorkshop\output\* excluding RequiredModules
Done /./build/Clean 00:00:00.0244961
===============================================================================
LOADDATUMCONFIGDATA
-------------------------------------------------------------------------------
/./build/LoadDatumConfigData
D:\Git\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.2.0\tasks\LoadDatumConfigData.build.ps1:30
Loading Datum Definition from 'D:\Git\DscWorkshop\source\Datum.yml'
Done /./build/LoadDatumConfigData 00:00:00.6779985
===============================================================================
TESTCONFIGDATA
-------------------------------------------------------------------------------
/./build/TestConfigData
D:\Git\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.2.0\tasks\TestConfigData.build.ps1:43
Project Name = 'DscWorkshop'
Source Path = 'source'
Output Directory = 'D:\Git\DscWorkshop\output'
Release Notes path = 'D:\Git\DscWorkshop\output\ReleaseNotes.md'
Built Module Subdirectory = 'D:\Git\DscWorkshop\output\AvoidPSPathOverlap'
Module Manifest Path (src) = 'D:\Git\DscWorkshop\source\DscWorkshop.psd1'
Module Version = '0.2.0-test'
Pester Output Folder = 'D:\Git\DscWorkshop\output\testResults
Creating folder D:\Git\DscWorkshop\output\testResults
Config Data Pester Scripts = [D:\Git\DscWorkshop\tests\ConfigData]
TestResultsPath is: D:\Git\DscWorkshop\output\testResults\IntegrationTestResults.xml
OutputDirectory is: D:\Git\DscWorkshop\output\testResults
Pester v5.3.3
Starting discovery in 2 files.
Discovery found 38 tests in 375ms.
Filter 'Tag' set to ('Integration').
Filters selected 38 tests to run.
Running tests.
Running tests from 'CompositeResources.Tests.ps1'
Describing Resources matching between Composite Resources and PSDepend file
Context Composite Resources import correct DSC Resources
[+] DSC Resource Module 'ComputerManagementDsc' is defined in 'RequiredModules.psd1' 124ms (84ms|40ms)
[+] DSC Resource Module 'xPSDesiredStateConfiguration' is defined in 'RequiredModules.psd1' 4ms (2ms|1ms)
[+] DSC Resource Module 'JeaDsc' is defined in 'RequiredModules.psd1' 3ms (2ms|1ms)
[+] DSC Resource Module 'xPSDesiredStateConfiguration' is defined in 'RequiredModules.psd1' 4ms (2ms|1ms)
[+] DSC Resource Module 'ComputerManagementDsc' is defined in 'RequiredModules.psd1' 4ms (2ms|1ms)
[+] DSC Resource Module 'xPSDesiredStateConfiguration' is defined in 'RequiredModules.psd1' 4ms (2ms|2ms)
[+] Version of 'ComputerManagementDsc' in 'ComputerSettings.schema.psm1' is equal to version in 'RequiredModules.psd1' 5ms (3ms|1ms)
[+] Version of 'xPSDesiredStateConfiguration' in 'ConfigurationBase.schema.psm1' is equal to version in 'RequiredModules.psd1' 2ms (1ms|1ms)
[+] Version of 'JeaDsc' in 'DscDiagnostic.schema.psm1' is equal to version in 'RequiredModules.psd1' 2ms (1ms|1ms)
[+] Version of 'xPSDesiredStateConfiguration' in 'DscLcmController.schema.psm1' is equal to version in 'RequiredModules.psd1' 2ms (1ms|1ms)
[+] Version of 'ComputerManagementDsc' in 'DscLcmController.schema.psm1' is equal to version in 'RequiredModules.psd1' 2ms (1ms|1ms)
[+] Version of 'xPSDesiredStateConfiguration' in 'DscLcmMaintenanceWindows.schema.psm1' is equal to version in 'RequiredModules.psd1' 3ms (1ms|2ms)
Running tests from 'ConfigData.Tests.ps1'
Describing Validate All Definition Files
[+] 'DSCFile01.yml' is a valid yaml 56ms (53ms|2ms)
[+] 'DscLcm.yml' is a valid yaml 28ms (27ms|1ms)
[+] 'Security.yml' is a valid yaml 10ms (9ms|1ms)
[+] 'Server.yml' is a valid yaml 22ms (21ms|1ms)
[+] 'Dev.yml' is a valid yaml 12ms (11ms|1ms)
[+] 'Prod.yml' is a valid yaml 8ms (7ms|2ms)
[+] 'Test.yml' is a valid yaml 73ms (71ms|1ms)
[+] 'Domain.yml' is a valid yaml 7ms (6ms|1ms)
[+] 'Frankfurt.yml' is a valid yaml 14ms (12ms|1ms)
[+] 'London.yml' is a valid yaml 9ms (8ms|1ms)
[+] 'Singapore.yml' is a valid yaml 9ms (8ms|1ms)
[+] 'Tokio.yml' is a valid yaml 9ms (7ms|1ms)
[+] 'DomainController.yml' is a valid yaml 11ms (10ms|2ms)
[+] 'FileServer.yml' is a valid yaml 27ms (26ms|1ms)
[+] 'WebServer.yml' is a valid yaml 49ms (48ms|1ms)
[+] 'Datum.yml' is a valid yaml 32ms (31ms|1ms)
Describing Datum Tree Definition
[+] Exists in source Folder 37ms (29ms|7ms)
[+] Is Valid Yaml 40ms (39ms|1ms)
[+] 'Get-FilteredConfigurationData' returned data 12ms (11ms|1ms)
Describing Node Definition Files
Context Testing for conflicts / duplicate data
[+] Should not have duplicate node names 8ms (3ms|5ms)
[+] 'DSCFile01' has valid yaml 40ms (33ms|6ms)
[+] 'DSCFile01' is in the right environment 13ms (4ms|9ms)
[+] Location of 'DSCFile01' is 'Frankfurt' and does exist 16ms (14ms|1ms)
Describing Roles Definition Files
[+] D:\Git\DscWorkshop\source\Roles\FileServer.yml has valid yaml 62ms (56ms|6ms)
Describing Role Composition
[-] DSCFile01 has a valid Configurations Setting (!$null) 86ms (82ms|4ms)
[-] Describe Node Definition Files.Role Composition failed
ScriptCallDepthException: The script failed due to call depth overflow.
RuntimeException: The script failed due to call depth overflow.
Tests completed in 1.89s
Tests Passed: 36, Failed: 2, Skipped: 0 NotRun: 0
BeforeAll \ AfterAll failed: 1
- Node Definition Files.Role Composition
ERROR: Assertion failed.
At D:\Git\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.2.0\tasks\TestConfigData.build.ps1:98 char:5
+ assert ($testResults.FailedCount -eq 0 -and $testResults.FailedBl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\Git\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.2.0\tasks\TestConfigData.build.ps1:43 char:1
+ task TestConfigData -if ($CurrentJobNumber -eq 1) {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build FAILED. 6 tasks, 1 errors, 0 warnings 00:00:06.7105615
assert : Assertion failed.
At D:\Git\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.2.0\tasks\TestConfigData.build.ps1:98 char:5
+ assert ($testResults.FailedCount -eq 0 -and $testResults.FailedBl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Assert-Build], Exception
+ FullyQualifiedErrorId : Assert-Build