Closed
Description
The company I work for is using trycmd
and we noticed our CI timing out on Windows. After some investigation, it appears writing more than 4096 bytes to stdout will result in trycmd
deadlocking on Windows. This is presumably related to #45572 in Rust (std::process::Command hangs if piped stdout buffer fills) and makes sense since Windows uses a much smaller buffer than Linux.
A reproducible test case on Windows:
// src/main.rs
fn main() {
// Change to 4096 and no deadlock appears
for _ in 0..4097 {
print!("a");
}
}
A simple trycmd
is all that it takes because we aren't looking for anything to actually pass or fail.
// tests/bug.rs
#[test]
fn trycmd_bug() {
let t = trycmd::TestCases::new();
t.cases("tests/bug.md");
}
In bug.md
:
$ trycmd-bug
a