Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work on Windows in GitHub Actions #52

Open
jwodder opened this issue Nov 30, 2022 · 6 comments
Open

Doesn't work on Windows in GitHub Actions #52

jwodder opened this issue Nov 30, 2022 · 6 comments
Labels

Comments

@jwodder
Copy link

jwodder commented Nov 30, 2022

Consider the following very simple use of expectrl:

use expectrl::{spawn, Error};
use std::time::Duration;

fn main() -> Result<(), Error> {
    println!("Spawning ...");
    let mut p = spawn("cat")?;
    p.set_expect_timeout(Some(Duration::from_secs(3)));
    println!("Sending line ...");
    p.send_line("Hello World")?;
    println!("Expecting line ...");
    p.expect("Hello World")?;
    println!("OK!");
    Ok(())
}

If this program is run in GitHub Actions (using expectrl 0.6.0 and Rust 1.65.0), it succeeds on Ubuntu and macOS but fails on Windows; you can see such a run here. In particular, the output on Windows is:

Spawning ...
Sending line ...
Expecting line ...
Error: ExpectTimeout
@zhiburt zhiburt added the help wanted Extra attention is needed label Nov 30, 2022
@zhiburt
Copy link
Owner

zhiburt commented Nov 30, 2022

Hi @jwodder

Thanks for report.

As I remember I've encountered some issues with windows CI as well.
But I didn't figure it out.

It might be something related to CI container/host itself.

@zhiburt
Copy link
Owner

zhiburt commented Nov 30, 2022

But I'll run it myself maybe something was changed after all.

@zhiburt
Copy link
Owner

zhiburt commented Nov 30, 2022

Actually, you know it might be a bug.

@zhiburt zhiburt added bug Something isn't working and removed help wanted Extra attention is needed labels Nov 30, 2022
@zhiburt
Copy link
Owner

zhiburt commented Nov 30, 2022

But wait.... there's no cat on windows.

To be precise it's a different program.

image

@zhiburt zhiburt removed the bug Something isn't working label Nov 30, 2022
@jwodder
Copy link
Author

jwodder commented Nov 30, 2022

@zhiburt Well, this was just an attempt at an MVCE. Trying to use expectrl with my actual (complicated) program still fails under Windows. What Windows program would you recommend for an MVCE?

@zhiburt
Copy link
Owner

zhiburt commented Mar 28, 2023

Hi @jwodder

Sorry that it was ignored for such a long time.

What Windows program would you recommend for an MVCE?

So I was playing with appveyor and github actions and neither of them "works".
I am not sure why still.....

I found out that both of them have a limited package of programs so I've tested custom python scripts.
And they both don't work.

So far it's still unclear why it fails.
I guess it might be some windows settings (e.g. I am not sure whether conpty requires some tweak inside windows settings)

https://ci.appveyor.com/project/zhiburt/expectrl-1oa5l/builds/46457768#L319
https://github.com/zhiburt/expectrl/actions/runs/4376327509/jobs/7658275779#step:8:82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants