Skip to content

perf(cli): the dashboard's reactive tests run in half today's time and still check every behaviour #1339

Closed

Description

@dan-petty

Problem

tests/test_ui_reactive.py is the most expensive test file: 3,463 lines, 198 test functions and 244 collected cases in 25 sections.

  • It costs a seventh of the suite. On 16 workers its cases sum to 144-146 s of the suite's 1,016-1,018 s (14%). In one process the file sums to 79-90 s of JUnit time (83-94 s for the run) [measured: 2026-10-07 at 36cfbbb, two runs each]. The next most expensive file, tests/test_structural_invariant_hook.py, sums to 37-38 s.
  • The cost sits in the tests that start the dashboard. All 64 app.run_test(...) calls start a full DashboardApp (64 DashboardApp( constructions in the file). In one process, 54-56 cases take 0.5 s or more and carry about 90% of the file's time; 171 of the 244 take under 0.1 s [measured].
  • Starting the app is not the whole cost.
    • test_a_panel_renders_a_snapshot_handed_to_it (:1292) starts the app and takes about 0.2 s.
    • test_escape_clears_the_filter_and_returns_to_the_table (:2828) drives a 63-row pod table through key presses and takes 1.1-1.4 s. One cProfile run puts much of that time in Textual's stylesheet application, mounting and rendering [measured].
  • Two stream tests flood the log pane. _endless yields a log line every 2 ms until it is released (:3188, sleep at :3197). _switched_cleanly waits for the new stream and then a fixed 0.3 s (:3204-3208, the pause at :3207).
    • test_opening_a_second_pod_stops_the_first_pods_stream (:3233) takes 7.6-9.5 s.
    • test_switching_containers_stops_the_previous_stream (:3212) takes 2.5-6.7 s.
    • They are the file's two slowest cases, alone, in one process and on 16 workers [measured].
  • The first case also pays the session setup. In a single-process run, JUnit time includes setup, so the file's first case, a 3 ms test, was reported at 2.6 s [measured]. The per-test limit below therefore uses the call phase.

Acceptance criteria

Key questions

  • Where does the time go? (proposed) Profile before changing anything. The likely candidates are:
    • the full app's stylesheet and compose step on every start;
    • the 63-row table re-rendered on each key press;
    • the 2 ms producer in the stream tests.
  • Should a test mount one panel instead of the whole dashboard? (proposed) Yes, for behaviours that belong to one panel, through a small host App built in the test module.
  • Is speed part of the test design? Decided 2026-10-07: no. This is a standalone P3 item outside test(cli): tests double only process edges and mirror the source tree #1307's phases, and the roadmap jobs rank it.

Strategic alignment

Activity

  1. added
    type/test
    scope/cli
    priority/p3-low
    on Oct 7, 2026
  2. dan-petty-bot commented on Oct 7, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P2-Medium. It cuts the most expensive test file's runtime by half (≈14% of suite time), improving developer and CI throughput, but nothing is blocked and no user-facing defect is involved.
    • Value: Medium. Halving the slowest test file's runtime meaningfully speeds up local iteration and CI, but the tests already pass and the feature they guard is stable.
    • Effort: Medium. Bounded to one 3,463-line test file with 198 functions; requires replacing full-app starts with panel-level hosts and fixing two stream-test timers, but no product code changes are permitted.
  3. added this to the v0.2.38 milestone on Oct 20, 2026
  4. added 2 commits that reference this issue on Oct 20, 2026
  5. dan-petty commented on Oct 20, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1740, merged into release/v0.2.38 as 542f7c1.

    The dashboard tests wait for conditions instead of fixed pauses. They also run with Textual's animations off and list a doubled Docker engine. Every behaviour is still checked.

    6 file(s) changed.

    How it was verified

    Check runs at 03d653b:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • devops-cli: pass
    • zizmor: pass
    • bandit: pass
    • CodeQL: pass
    • Dependency Freshness: skipping
    • Static Analysis: pass
    • Rule Pack Tests: pass
    • Fail-to-Pass Check: pass
    • Changed-Test Independence: pass
    • Fail-to-Pass Self-Check: pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • Analyze (actions): pass
    • Service Image: skipping
    • DevContainer Image: skipping

    Acceptance Criteria of docs/agent/tasks/task-1339-dashboard-tests-half-time.md:

    No Acceptance Criteria section.

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

    priority/p3-lowscope/clitype/test

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions