Flaky test: test_capture_pane_flags[join_wrapped_numbers] matches marker in command echo

オープン 初心者向け
#654 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
testing-qa

調査の方向性

test_capture_pane_flags[join_wrapped_numbers] と、issue に示されている command_complete() のチェックから始めます。断続的な失敗を再現し、marker が shell コマンドのエコーではなくコマンド出力からのみ検出されることを確認し、名前が示されているテストを実行して確実にパスすることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Bug

test_capture_pane_flags[join_wrapped_numbers] fails intermittently because the completion marker is detected in the shell command echo line before the command actually executes.

Root cause

The command_complete() check uses:

def command_complete() -> bool:
    output = "\n".join(pane.capture_pane())
    return marker in output

This matches the marker string inside the prompt echo ($ printf ... echo "__DONE_join_wrapped_numbers__") — a false positive. The shell echoes the full command before executing it, so the marker appears in the pane buffer before seq produces any output.

Expected behavior

The marker should only be detected when it appears as command output (its own line), not as part of the typed command echo.

Fix

Change the check to skip lines that start with the shell prompt ($):

def command_complete() -> bool:
    lines = pane.capture_pane()
    return any(marker in line and not line.lstrip().startswith("$") for line in lines)

Reproduction

The failure is timing-dependent. On fast systems seq completes before the next capture, masking the bug. On slower systems or CI, the race is more visible.

主要言語
Python
スター
1.2k
フォーク
127
平均マージ
2時間 13分
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tmux-python/libtmux のほかの issue

tmux-python/libtmux の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。