actions / actions/runner

Unable to use conpty pseudo-terminal on Windows runner

Open
#3,168 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug

On windows-latest, the conpty pseudo-terminal library does not write to the expected pipe, the output appears in the actions log output but never gets written to the pipe so read operations fail.

Here is some sample Rust code that reproduces the issue:

use std::io::Read;

#[test]
#[cfg(windows)]
fn conpty_echo() {
    let mut proc = conpty::spawn("echo Hello World").unwrap();
    let mut reader = proc.output().unwrap();
    let mut buf = [0; 1024];
    reader.read(&mut buf).unwrap();
    assert!(String::from_utf8_lossy(&buf).contains("Hello World"));
}

The output in the Github runner looks like this:

running 1 test
Hello World
test conpty_echo has been running for over 60 seconds

To Reproduce

Deploy the above test spec to a windows-latest runner.

Expected behavior

I expect the read operation on the pseudo-terminal to complete.

This code works as expected running locally on Windows to it appears to be something specific to the github runner. I have pseudo-terminal based tests working fine on Linux and MacOS runners and would really like to run the same tests in a Windows pseudo-terminal.

Any help understanding this much appreciated 🙏

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by deploying the provided Rust conpty_echo test on a windows-latest runner and compare its pipe behavior with local Windows execution. Inspect the runner's Windows pseudo-terminal handling using the reproduction and action logs; done means the read completes and the Hello World assertion passes on the GitHub runner.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, rust
Domain
ci-cd, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.