Skip to content

cli_watch harness: wait_for_stderr_contains_str returns the partial text on timeout, so count assertions built on it are vacuous #381

Description

@dean0x

crates/mds-cli/tests/cli_watch.rs:4102-4111 (main 2b91850) polls every 20 ms and RETURNS whatever text it has when the timeout elapses instead of panicking. Any assertion that counts occurrences in its return value cannot distinguish "not arrived yet" from "wrong count". Related: i16–i20 sample stderr_tap.text() with no wait at all right after a file-content wait, and in dir mode the duplicate-key warning is emitted AFTER the output write (watch.rs:2021 after :1597), so the sample races the emit (i17 left 1, right 2 in run 34404318888). Fix direction (C2): a bounded wait_for_stderr_count(tap, needle, n, timeout) that panics with the text on timeout, followed by a joined finish_text for the exact count; migrate the count sites; keep or delete the vacuous helper. Refs #320.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions