DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Piping sometimes does not work on Linux

Open anmenaga opened this issue 2 years ago • 1 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest version
  • [X] Search the existing issues.

Steps to reproduce

This was seen only on CI machines. Test failure in export test case that is doing dsc config export | dsc config set. On local VMs this does not repro.

Error: IO: Broken pipe (os error 32)
Error: [-] resource export tests.Configuration Export can be piped to configuration Set 5.09s (5.09s|3ms)
Message
  Expected 0, but got 2.
  at $LASTEXITCODE | Should -Be 0, /home/runner/work/DSC/DSC/dsc/tests/dsc_export.tests.ps1:49
  at <ScriptBlock>, /home/runner/work/DSC/DSC/dsc/tests/dsc_export.tests.ps1:49

Expected behavior

`dsc config export | dsc config set` always runs fine.

Actual behavior

Error above.

Error details

No response

Environment data

Linux CI VM.

Version

v1

Visuals

No response

anmenaga avatar Sep 01 '23 19:09 anmenaga

A broken pipe probably means that upstream dsc config export didn't exit cleanly and broke the pipe. Maybe we need to add tracing to how dsc handles child processes that don't exit cleanly (such as if the process test process panic'd).

SteveL-MSFT avatar Sep 17 '23 03:09 SteveL-MSFT