mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix $PSDefaultParameterValues leak causing tests to skip unexpectedly (#26602)
This fixes test isolation issues where six test files were leaking $PSDefaultParameterValues["It:Skip"] settings to subsequent tests, causing widespread test skipping on Linux. The fixes address two distinct patterns: using .Remove() which doesn't restore the original state (4 files), and imbalanced Push-DefaultParameterValueStack/Pop-DefaultParameterValueStack calls (2 files).
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
Describe "Acl cmdlets are available and operate properly" -Tag CI {
|
||||
Context "Windows ACL test" {
|
||||
BeforeAll {
|
||||
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
|
||||
$PSDefaultParameterValues["It:Skip"] = -not $IsWindows
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ Describe "Acl cmdlets are available and operate properly" -Tag CI {
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$PSDefaultParameterValues.Remove("It:Skip")
|
||||
$global:PSDefaultParameterValues = $originalDefaultParameterValues
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user