Repository navigation
Move 45 over-budget tests to daily journeys, and stop five waiting out an unanswered title completion - #6732
Conversation
…y journeys Each moved function ran over its directory's budget (browser 8 s, model and process 3 s) in both the 2026-11-21 (44896279165) and 2026-11-20 (44722728605) scheduled ci runs, per leaf-dev suite profile. The browser tests now run daily instead of on each push to main; the model and process tests leave a pull request's broad selection for the daily run. No test body changes.
leaf-agent
left a comment
There was a problem hiding this comment.
Five of the ⏱ moves aren't slow tests. Each waits out one 60 s deadline the suite causes itself, so moving them to journeys/ hides that cause instead of fixing it. The five are test_each_case_of_an_event_is_told_what_the_snapshot_shows, test_reply_command_guides_selection_and_followup, test_site_page_accepts_events_across_build_and_container_python_versions, test_every_state_answer_holds_the_served_state_schema and test_a_written_comment_keeps_its_originating_agent.
In each of them a comment reaches a page claimed by a Claude Code session, so the page server starts a leaf-thread-title worker. That worker asks the session for a completion through completions.ask. No hooks module runs in a test, so nothing answers, and the ask polls until inference.TIMEOUT (60 s). Then retire_test_services joins the worker at teardown (worker.join(timeout=STATED_TIMEOUT)). A faulthandler dump at 25 s shows the main thread in that join and the worker in completions.py ask. The suite already makes the subprocess harnesses fail at once for the same reason (FAILING_HARNESS_PROGRAMS in tests/conftest.py), but the Claude Code completion route doesn't go through those programs.
This matters most for the snapshot test. It records what the agent is told for each $events clause, and a change to a clause is meant to show up as a diff in that change's own PR. Moved to journeys/, the diff would first show up as a red daily run on main.
Fix: before ending each session, retire_test_services answers that session's pending completions as failed calls (completions.pending / completions.replied), the same way the module reports a failed call. With that change, all five pass in under 3 s locally, and the browser one in about 5 s, so each stays in its own tier. I'll push that fix and move these five back. The other 45 moves, including the two 120 s ones, stand as they are.
…ep five tests in their tiers Five tests the over-budget move sent to journeys each took about 60 s because a comment on a page that a Claude Code session claims starts a thread-title worker. The worker asks the session for a completion that no hooks module answers in a test, so it waits out `inference.TIMEOUT`, and `retire_test_services` joins it. Teardown now answers each pending completion as a failed call, the way the module reports one. With that change the five run in under 7 s locally: - test_each_case_of_an_event_is_told_what_the_snapshot_shows (model) - test_reply_command_guides_selection_and_followup (model) - test_site_page_accepts_events_across_build_and_container_python_versions (model) - test_every_state_answer_holds_the_served_state_schema (process) - test_a_written_comment_keeps_its_originating_agent (browser) They return to their tiers, so a change to an `$events` clause again shows its snapshot diff in its own pull request.
|
@leaf-agent The revised teardown scans pending requests once before stopping servers or joining title workers. A
|
…rker ends Teardown answered the pending completions once, before stopping servers. A title worker that reached `completions.ask` after that scan waited the whole `inference.TIMEOUT` for a hooks module no test runs. Teardown now answers the sessions' pending completions between each poll of the join, until every title worker has ended. A regression test holds the real Claude Code generator just before it writes its request and releases it once teardown joins the worker; it records the "test ended" answer rather than the 60 s timeout.
|
Fixed in ac9973f: The new |
This week's duplicate sweep of `dev/`, `build/`, `tests/` and `worker/` (week 47) moves six duplicated helpers onto one home each and moves every caller. Behavior stays the same. The touched model tests, the dev js_facts tests and the Worker's routing, storage and index tests pass. A script compared the old and new outputs of the consolidated `leaf_dev` functions and the seeded-log reads across the corpus, and they match. | Question | Home | Copies removed (introducing PR) | |---|---|---| | Which stylesheets do the core and the bundled packages ship, leaving out vendored files? | new `interact_support.shipped_sheets` | `sheets()` in `test_interface_fonts.py` (#4804) and `test_theme_tokens.py` (#6025). Five inline loops in `test_interact_layer.py` (#3138, #3886) | | Run `tests/js_facts.mjs` | `interact_support.js_facts` (#2666) | its own subprocess call in `dev/tests/test_js_facts.py` (#5118) | | Lowercase hex of bytes in the Worker | `routing.hex`, which is `newSessionId` (#313) renamed, plus a `sha256Hex` in `storage.ts` | the publication-identity and chunk-digest copies in `storage.ts` (#2652) | | Is this pid alive? | `leaf.machine.pid_alive` | `_alive` in `tests/process/test_codex_tool.py` (#3331). `running()` in `test_interact_layer.py` (#1774) | | Read an example's seeded log | `read_event_lines(seed_log(source))` (#4484) | inline parsers in `test_render_pages.py`, `test_interact_product.py` (#924) and `test_render_gate.py` (#509). The last one split lines with `splitlines()`, which also breaks at U+2028 | | Paths of the bundled registries and packages; which registry keys name elements | `leaf.schema.ASSETS` / `BUNDLED_PACKAGES` / `DEFAULT_PACKAGE`, `leaf.registry.contract.is_element_name`, `docs.registries()` | `docs.py`'s own `ASSETS`/`PACKAGES` (#3593) and its `startswith("lf-")` checks (#2660). `logs usage`'s hand-written regex and registry list (#5970). `ROOT / "packages" / "default"` in `stills.py` (#3927) and `test_product_page.py` (#3593) | `is_element_name` and the two checks it replaces give the same answer for every key in the bundled registries today. A selector key such as `lf-options.selected` would have passed the `lf-` prefix test. <details><summary>Sets found and left alone</summary> - **Sets an open PR is changing.** Nothing in this diff overlaps another open PR's hunks. #6732 moves tests out of `test_render_gate.py`, `test_render_pages.py` and `test_interact_layer.py`, but none of the tests changed here. - **Changes to browser tests with nothing run to check them.** The WCAG contrast computation exists as about 11 copies across browser, journey and model tests. Other copies: about 9 `EDITOR_ROOTS` shadow-root keepers, the `/api/interaction` batch predicates, CDP `touch()` closures, one-line patch templates, reply-holding route handlers, and the `data-lf-entry` runtime-module import snippet in `dev/leaf_dev/states.py` and in tests. Each would mean editing browser tests that this sweep can't run on a shared host. They suit a sweep that can run those tests. - **Vendor bundling.** `build/browser/build.mjs` builds signals-core and Lit with esbuild calls that repeat `build/vendor.mjs`'s `bundle()`. Merging them changes build options and needs a full `check:browser` byte comparison, so it was left for a change that runs that. - **Copies that are near but not the same.** `_build.py`'s `check_links` repeats `leaf_website.released_path`, but it also needs the matched page's root and kind. The list of API-key variables an eval drops is repeated across Python and the Promptfoo configs, as subsets and supersets of one another. The Codex token-expiry check has different thresholds, 1 h and 60 s. - **Too small to be worth it.** Picking a free loopback port (`eval_user.py`, `interact_support.available_loopback_port`). The XDG state root in `leaf_dev.state_home` and `leaf.state.state_home`. The `settled` helper in two `tests/runtime` files. </details> Co-authored-by: leaf-agent <[email protected]>
Move 45 test functions that ran over their tier's time budget in both of the last two daily runs, November 21 (44896279165) and November 20 (44722728605), into the daily
tests/journeys/tier, astests/AGENTS.mdasks of a test over its directory's budget. 29 come fromtests/browser/(8 s budget), 13 fromtests/model/and 3 fromtests/process/(3 s budget). Each moved function's source is the same at both runs' commits and at this branch's base, and each had a passing over-budget case in both runs. Only when they run changes: the browser tests now run daily instead of on each push to main, and the model and process tests leave a pull request's broad selection for the daily run.No test body changes. Each function moves to the same relative path under
tests/journeys/, imports its helpers from the module it left, and takes that module'spytestmark.notes/browser-support.mdnow names the new location oftest_hosting.py's chart test, andsrc/leaf/registry/contract.pynames the snapshot's actual directory,tests/model/interact_contract/_regtest_outputs/.Five more tests were over budget in both runs, at about 60 s each. They stay in their tiers, because the suite caused the wait: a comment on a page that a Claude Code session claims starts a thread-title worker, which asks the session for a completion that no hooks module answers in a test, and
retire_test_servicesthen joins that worker untilinference.TIMEOUTends the ask. Teardown now answers the sessions' pending completions as failed calls, the way the module reports one, and keeps answering while it joins the title workers, so a worker that asks only after teardown begins is answered too (a regression test intests/process/test_interact_server.pyholds a worker just before its request until teardown joins it); and the five run in under 7 s locally:test_each_case_of_an_event_is_told_what_the_snapshot_shows,test_reply_command_guides_selection_and_followup,test_site_page_accepts_events_across_build_and_container_python_versions,test_every_state_answer_holds_the_served_state_schemaandtest_a_written_comment_keeps_its_originating_agent.Two of the moves sit just above 120 s in all three runs read (rows marked ⏱ below), which looks like each waits out a fixed interval. I haven't checked what they wait on; making them faster would let them return to their tier.
Verification: collecting every tier gives the same test ids as the base apart from the tier directory (only
test_suite_source.py's per-module cases differ, since they follow the files);--setup-planresolves every moved case's fixtures;tests/model/test_suite_source.py(1,608 passed),ty check --error-on-warning tests, Ruff and pre-commit pass on the changed files; the moved model and process functions, one browser test from each new journeys module, the five tests kept in their tiers (both regtest snapshots among them),tests/model/interact_contract/test_layer_contract.pyandtests/model/test_thread_titles.pypass.The daily readings behind each move (seconds per case, from
leaf-dev suite profile)Times are the function's over-budget passing cases in each run, as a range where several parameter cases were over. A function moves as one unit. November 19 (44509509454) is shown for context; "—" means no case was over budget that day.
tests/journeys/controls/test_command_routes.py::test_widget_context_keys_work_without_an_obligationtests/journeys/controls/test_command_routes.py::test_widget_owned_inline_hints_follow_reachable_commandstests/journeys/controls/test_previews.py::test_a_message_s_parts_follow_its_accepted_edittests/journeys/controls/test_theme_and_device.py::test_a_page_s_reset_leaves_leaf_s_controls_their_facestests/journeys/drafts/test_shared_drafts.py::test_words_typed_on_a_reload_stand_over_the_send_it_cut_shorttests/journeys/margin/test_card_placement.py::test_the_rail_tab_stop_follows_a_carried_row_back_into_view⏱tests/journeys/margin/test_card_reply.py::test_a_card_says_new_reply_for_an_answer_past_its_transcript_s_foottests/journeys/margin/test_pins.py::test_a_pass_for_a_change_to_the_rows_seats_them_as_a_whole_pass_wouldtests/journeys/margin/test_scrollers.py::test_rows_follow_a_pane_and_a_shadow_scroller_in_every_enginetests/journeys/navigation/test_comment_marks.py::test_marked_words_are_seen_and_told_aparttests/journeys/navigation/test_comment_marks.py::test_o_gives_marked_words_their_own_colours_backtests/journeys/startup/test_changes_in_place.py::test_v_marks_what_changed_since_the_latest_version_and_takes_marks_offtests/journeys/startup/test_hosting.py::test_a_chart_in_a_sample_off_screen_waits_for_the_reader_and_a_check_shows_ittests/journeys/startup/test_hosting.py::test_a_sample_reached_while_loading_holds_growth_the_reader_did_not_causetests/journeys/startup/test_hosting.py::test_a_sample_starts_its_page_as_it_nears_the_windowtests/journeys/test_page_inspection.py::test_about_copy_on_plain_http_machine_nametests/journeys/test_public_api.py::test_package_render_checks_every_exercised_output_before_withdrawaltests/journeys/test_render_anchors.py::test_page_search_reads_a_docs_captions_title_apart_from_its_texttests/journeys/test_render_application_boundary.py::test_packages_and_panel_share_threads_through_gestures_and_authored_contenttests/journeys/test_render_diff_controls.py::test_file_tree_opens_current_diff_files_by_pointer_and_keyboardtests/journeys/test_render_files.py::test_picking_a_file_under_an_open_panel_brings_it_cleartests/journeys/test_render_floating_panel.py::test_a_thread_s_keys_answer_in_its_viewtests/journeys/test_render_floating_panel.py::test_the_field_reads_a_status_it_cuts_short_wholetests/journeys/test_render_gate.py::test_a_handover_waits_while_arrivals_land_and_ends_once_they_stoptests/journeys/test_render_gate.py::test_an_unanswered_startup_resource_fails_the_render_gate⏱tests/journeys/test_render_gate.py::test_the_gate_reads_a_sample_far_below_the_windowtests/journeys/test_render_shift_watch.py::test_a_jump_owns_the_fit_of_the_live_sample_it_brings_neartests/journeys/widgets/test_tabs.py::test_a_side_list_longer_than_the_window_keeps_its_tab_and_open_item_in_viewtests/journeys/widgets/test_workspaces_and_bounds.py::test_a_page_up_in_a_log_a_stream_feeds_leaves_its_endtests/journeys/interact_contract/test_authored_markup.py::test_check_advises_an_allocation_leaf_ignores_where_it_standstests/journeys/test_interact_anchors.py::test_a_blank_line_that_splits_a_messages_pre_is_refusedtests/journeys/test_interact_anchors.py::test_a_widget_sharing_its_opening_line_is_refused_for_its_paragraph_alonetests/journeys/test_interact_document.py::test_check_advises_on_a_language_class_nothing_will_colourtests/journeys/test_interact_layer.py::test_a_layer_that_reads_a_pages_copy_lasts_as_long_as_the_pages_memorytests/journeys/test_interact_layer.py::test_package_list_describes_each_selectable_package_in_its_own_wordstests/journeys/test_responses.py::test_an_undeclared_answer_names_what_lets_its_widget_asktests/journeys/test_server_lifetime.py::test_a_temporary_server_ends_when_the_process_that_ran_it_exitstests/journeys/test_server_lifetime.py::test_server_stop_closes_accepted_keep_alive_connectionstests/journeys/test_server_lifetime.py::test_server_stop_reports_a_server_that_exits_as_soon_as_it_is_disabledtests/journeys/test_session_lifecycle.py::test_a_prompt_says_why_a_page_did_not_start_and_tries_againtests/journeys/test_session_lifecycle.py::test_a_prompt_serves_only_a_page_its_session_still_means_to_servetests/journeys/test_session_lifecycle.py::test_a_resumed_sessions_first_prompt_serves_its_page_againtests/journeys/test_interact_server.py::test_a_loopback_serve_says_the_url_opens_only_on_this_machinetests/journeys/test_interact_server.py::test_sample_capability_authorizes_only_its_live_descendantstests/journeys/website_server/test_saved_records.py::test_a_later_release_restores_a_visitors_page_as_they_left_itCandidates left in place
Over budget in both runs but not moved, because the function changed between the measured commits and this base:
tests/model/test_themes.py::test_a_personal_theme_builds_on_the_reading_look(no longer at that path on the base)tests/model/test_themes.py::test_a_new_page_reads_in_leaf_s_look_unless_it_takes_none