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

Sporadically failing CI testcases #104

Open
souze opened this issue Apr 26, 2023 · 1 comment
Open

Sporadically failing CI testcases #104

souze opened this issue Apr 26, 2023 · 1 comment

Comments

@souze
Copy link
Collaborator

souze commented Apr 26, 2023

We have some sporadically failing testcases, which blocks CI.
Has been discussed in #101 among other PRs. But I'm opening an issue to keep the discussion in one place.

I'm able to reliably reproduce the failure on my machine like so:

I=1; while cargo nextest run test_read_line; do I=$(($I+1)); echo "PASS $I"; done; echo "FAIL $I"
    Starting 1 tests across 1 binaries (19 skipped)
        FAIL [   0.207s] rexpect session::tests::test_read_line

--- STDOUT:              rexpect session::tests::test_read_line ---

running 1 test
test session::tests::test_read_line ... FAILED

failures:

failures:
    session::tests::test_read_line

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 19 filtered out; finished in 0.21s


--- STDERR:              rexpect session::tests::test_read_line ---
thread 'session::tests::test_read_line' panicked at 'assertion failed: `(left == right)`
  left: `"hans"`,
 right: `"hanshans"`', src/session.rs:437:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

   Canceling due to test failure: 0 tests still running
------------
     Summary [   0.207s] 1 tests run: 0 passed, 1 failed, 19 skipped
        FAIL [   0.207s] rexpect session::tests::test_read_line
error: test run failed
FAIL 270

It failed after 270 runs of the test. I'm running Ubuntu 20.

@souze
Copy link
Collaborator Author

souze commented Apr 27, 2023

So, I removed the code that turn echo off:

rexpect/src/process.rs

Lines 121 to 123 in 52edda7

let mut flags = termios::tcgetattr(STDIN_FILENO)?;
flags.local_flags &= !termios::LocalFlags::ECHO;
termios::tcsetattr(STDIN_FILENO, termios::SetArg::TCSANOW, &flags)?;

That results in test_bash and test_bash_control_chars consistently failing. But it seems to remove the flakyness from test_read_line.

Very odd to me. I guess bash and cat set some flags inside their own process that affects us differently?

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

No branches or pull requests

1 participant