Repository navigation
Closed
Labels
priority/p3-lowPriority P3: a small improvementscope/cliCore CLI framework, Typer subcommands, options, and tablestype/testType test: a new or changed test
Milestone
Description
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 fullDashboardApp(64DashboardApp(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.
_endlessyields a log line every 2 ms until it is released (:3188, sleep at:3197)._switched_cleanlywaits 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
- (person-run) Baseline first. At the item's base, on an otherwise idle devcontainer, the task file records the median of three single-process runs of
uv run pytest -q -n0 -p no:cacheprovider --durations=0 --junitxml=<tmp>/ui.xml tests/test_ui_reactive.py, as summed JUnit time (79-90 s on 2026-10-07). If test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313 has moved the file, the run uses its new path; if test(telemetry): telemetry, server, ui, output and docs tests run on edge fakes, and the dashboard suite splits by behaviour #1334 has split it, the run covers the files it was split into. - (person-run) After the change, that median is at most half its baseline, and in those runs no test's call phase takes more than 2 s, as
--durations=0reports. - Every behaviour is still checked:
- the file (or the files it was split into) collects at least as many cases as at the base, and none is skipped;
- both stream tests still fail when the dashboard leaves the old stream running. The builder disables the stop locally, watches both tests fail and reverts the change; the PR notes the result.
- Behaviours that span panels (tab switching, refresh, focus moving between panels) still run against the real
DashboardApp. - Only test code changes. No product code is added or changed for the tests' sake, and the file is neither moved nor split here: test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313 moves it and test(telemetry): telemetry, server, ui, output and docs tests run on edge fakes, and the dashboard suite splits by behaviour #1334 splits it into behaviour files, before or after this item.
- The diff adds no patch aimed at a devops-cli module and no import of a private devops-cli name, so the test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 ratchets cannot rise.
-
changelog.d/<n>.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited. -
uv run devops cipasses.
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
Appbuilt 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
- Milestone: none; the roadmap tooling places it. Depends on: none. Blocks: none. Related: test(cli): tests double only process edges and mirror the source tree #1307; perf(ci): the gate's test workers start at least 15% faster, and the full test run keeps at least half of that saving #1338 (per-worker start-up); test(cli): every test file sits in the directory mirroring the package it tests or in tests/invariants/, and the root conftest holds only the hermetic floor #1313 (moves the file); test(telemetry): telemetry, server, ui, output and docs tests run on edge fakes, and the dashboard suite splits by behaviour #1334 (splits the
uitests into behaviour files); test(cli): ratchets hold internal patches, private imports and test accommodations in src at today's counts and name each site that would raise one #1309 (the ratchets on internal patches and private imports). - Evidence tags: [code: path:line] was read at 5c45b1e (release/v0.2.28), where
tests/test_ui_reactive.pyis unchanged since 36cfbbb. [measured: …] was run at 36cfbbb on 2026-10-07.
Metadata
Metadata
Assignees
Labels
priority/p3-lowPriority P3: a small improvementscope/cliCore CLI framework, Typer subcommands, options, and tablestype/testType test: a new or changed test
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 7, 2026
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.
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.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.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.docs(tasks): record #1725's devcontainer row as done, and the UI row …
perf(tests): the dashboard tests wait on conditions, with animations …
dan-petty commentedon Oct 20, 2026
What changed
#1740, merged into
release/v0.2.38as 542f7c1.6 file(s) changed.
How it was verified
Check runs at 03d653b:
Acceptance Criteria of
docs/agent/tasks/task-1339-dashboard-tests-half-time.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)