Skip to content

TUI cold-start: measure actual mount time, not test sleep #25

Description

@codex-devlab

Severity: Minor (test quality)
Source: PR #16 review (M8)

tests/test_tui_cold_start.py:14-21 measures `time.sleep(0.85)` then asserts `elapsed < 0.95`. Since elapsed ≈ 0.85 always (modulo scheduler jitter), the assertion only fails on extreme stalls. This does NOT measure cold start time — it measures the test's own sleep call.

Fix

  • Add a `--probe-startup-time` debug flag to `rune review` that prints `READY <epoch_ms>` to stdout the moment Textual mounts.
  • Test reads stdout until that marker appears, times the delta from subprocess spawn.
  • Use the actual measured value to assert `< 800ms` per the spec.

Alternative: use `textual.pilot` for in-process timing instead of subprocess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions