Skip to content

Fix stale tmux controller tests and malformed pane output handling #99

Description

@pchalasani

Problem

Four tests/test_tmux_cli_controller.py tests fail on main as well as on
feat/workflow-callback:

  • TestCreatePane::test_invalid_pane_id_returns_none
  • TestCreatePane::test_valid_pane_id_returned
  • TestExecute::test_execute_successful_command
  • TestExecute::test_execute_failed_command

Findings

The create-pane tests use a single _run_tmux_command return value, but
create_pane() now lists existing panes and verifies the returned pane. The mocks
no longer model that command sequence. A mocked short value such as %123 or
invalid reaches list_panes(), whose parser assumes at least five pipe-separated
fields and raises IndexError.

The execute tests hard-code markers such as __TMUX_EXEC_START_12345__, while
generate_execution_markers() now creates PID-and-nanosecond-specific markers.
The production parser correctly looks for the generated markers, so the stale
fixtures time out or return unparsed output.

There is also a real robustness gap independent of the stale mocks:
list_panes() should reject malformed or incomplete tmux records instead of
raising IndexError.

Proposed work

  • Update create-pane mocks with command-aware side effects covering list, split,
    and verification calls.
  • Patch marker generation in execute tests or derive captured output from the
    generated markers.
  • Make list_panes() safely skip or report malformed records.
  • Add focused malformed-output regression cases.
  • Run the complete tmux controller and execution-helper suites.

Acceptance criteria

  • All four named tests pass without weakening production verification.
  • Malformed tmux output cannot crash list_panes().
  • Tests still verify successful output parsing, nonzero exit codes, invalid pane
    IDs, and verified pane creation.
  • The full repository suite introduces no new failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions