-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module
Description
Note: I can only reproduce this reliably on macOS 10.15.4.
I see it occasionally on Ubuntu 18.04, and can never reproduce it on Windows.
It may be connected to using Start-Sleep inside the script block; not sure if the fact that a custom class is used across thread boundaries is relevant [update: it is]
Steps to reproduce
class Foo { static [object] Echo($val) { return $val } }
$cls = [Foo]
while ($true) {
$res = 1..10 | ForEach-Object -Parallel {
Start-Sleep -ms 100; ($using:cls)::echo($_)
} | Sort-Object
Compare-Object $res (1..10) | Should -BeNullOrEmpty
Write-Host -NoNewline .
}Expected behavior
The loop should run indefinitely, because the test should alway succeed.
Actual behavior
The loop eventually - after a varying number of iterations - breaks due to intermittent test failures, stemming from a missing output; e.g.:
Expected $null or empty, but got @(@{InputObject=5; SideIndicator==>})
That is, not all input objects were echoed.
Environment data
PowerShell Core 7.1.0-preview.3 on macOS 10.15.4
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module