Skip to content

EPIPE error on windows with pwsh #3908

Open
@testlabauto

Description

@testlabauto

Describe the bug
When I attempt to run two steps in a run that are both pwsh which run npx playwright test, I get the following in the second setp:

Error: EPIPE: broken pipe, write
    at Socket._write (node:internal/net:61:18)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:[50](https://github.com/posit-dev/positron/actions/runs/15593387347/job/43917821234?pr=8027#step:23:51)1:10)
    at Socket.Writable.write (node:internal/streams/writable:[51](https://github.com/posit-dev/positron/actions/runs/15593387347/job/43917821234?pr=8027#step:23:52)0:10)
    at console.value (node:internal/console/constructor:303:16)
    at console.log (node:internal/console/constructor:378:26)
    at prepareTestEnv (C:\a\positron\positron\test\e2e\infra\test-runner\test-setup.ts:30:11)
    at globalSetup (C:\a\positron\positron\test\e2e\tests\_global.setup.ts:18:16)
    at Object.setup (C:\a\positron\positron\node_modules\playwright\lib\runner\tasks.js:167:33)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at taskLoop (C:\a\positron\positron\node_modules\playwright\lib\runner\taskRunner.js:68:11)
    at TaskRunner.runDeferCleanup (C:\a\positron\positron\node_modules\playwright\lib\runner\taskRunner.js:85:5)
    at TaskRunner.run (C:\a\positron\positron\node_modules\playwright\lib\runner\taskRunner.js:45:9)
    at runTasks (C:\a\positron\positron\node_modules\playwright\lib\runner\tasks.js:72:18)
    at Runner.runAllTests (C:\a\positron\positron\node_modules\playwright\lib\runner\runner.js:75:20)
    at runTests (C:\a\positron\positron\node_modules\playwright\lib\program.js:215:18)
    at t.<anonymous> (C:\a\positron\positron\node_modules\playwright\lib\program.js:55:7)
Emitted 'error' event on Socket instance at:
    at Socket.onerror (node:internal/streams/readable:1028:14)
    at Socket.emit (node:events:[52](https://github.com/posit-dev/positron/actions/runs/15593387347/job/43917821234?pr=8027#step:23:53)4:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4047,
  syscall: 'write',
  code: 'EPIPE'
}

Here is my second test step (the previous one is very similar):

      - name: Run Main Test Suite (Electron)
        shell: pwsh
        env:
          POSITRON_PY_VER_SEL: 3.10.10
          POSITRON_R_VER_SEL: 4.4.0
          POSITRON_PY_ALT_VER_SEL: 3.13.0
          POSITRON_R_ALT_VER_SEL: 4.4.2
          CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
          CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
          COMMIT_INFO_MESSAGE: ${{ github.event.head_commit.message }}
          PWTEST_BLOB_DO_NOT_REMOVE: 1
          CURRENTS_TAG: ${{ inputs.currents_tags || 'electron/win'}}
          ENABLE_CURRENTS_REPORTER: ${{ inputs.report_currents }}
          CURRENTS_PROJECT_ID: ${{ vars.CURRENTS_PROJECT_ID }}
        run: |
          $env:SKIP_BOOTSTRAP = "true"
          $env:SKIP_CLONE = "true"
          npx playwright test --project "e2e-windows" --grep "${{ env.PW_TAGS }}" --workers 2 --repeat-each ${{ inputs.repeat_each }} --max-failures 10

          $BOOTSTRAP_EXIT_CODE = [int]"${{ steps.bootstrap.outputs.BOOTSTRAP_EXIT_CODE }}"
          if ($BOOTSTRAP_EXIT_CODE -ne 0) {
            Write-Host "Bootstrap extensions test failed earlier. Exiting with code $BOOTSTRAP_EXIT_CODE."
            exit $BOOTSTRAP_EXIT_CODE
          }

To Reproduce
Steps to reproduce the behavior:
Unfortunately, I think running my workflow may be required. If you can see it, here is a link to a failed run:
https://github.com/posit-dev/positron/actions/runs/15593387347/job/43917821234?pr=8027#step:23:48

Expected behavior
Should be possible to use pwsh steps to run two playwright test steps in a row.

It would be great if I could just fix this with a pin, but I am using 8x:

jobs:
  e2e-windows:
    name: ${{ inputs.display_name }}
    runs-on:
      labels: [windows-latest-8x]
    timeout-minutes: 100
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      POSITRON_BUILD_NUMBER: 0 # CI skips building releases
      AWS_S3_BUCKET: positron-test-reports
      E2E_CONNECT_SERVER: ${{ secrets.E2E_CONNECT_SERVER}}
      E2E_CONNECT_APIKEY: ${{ secrets.E2E_CONNECT_APIKEY}}

Runner Version and Platform

Version of your runner?
Version: 20250602.1.0

OS of the machine running the runner? OSX/Windows/Linux/...
Windows

What's not working?

Please see Describe section

Job Log Output

Please see Describe section

Runner and Worker's Diagnostic Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions