Skip to content

test_read_line fails randomly #70

@petreeftime

Description

@petreeftime

I was unable to reproduce the issue on my own. So far the only time it showed up is in https://github.com/philippkeller/rexpect/actions/runs/3060626462/jobs/4939368842, for PR #47.

I've reviewed the code involved in this test, but there was nothing obvious that could lead to such an issue. What I expected was that there's some sort of race condition where Session::read_line starts reading before the \n is available, and so it ends up reading the string once, stopping because it can't match and then reading again, but NBReader looks like it would correctly accumulate characters into the buffer and the whole operation is retried until the match is found in the buffer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions