Repository navigation
[code-review] Code-review cleanup: vacuous and host-dependent assertions in crates/orbit-cli/tests/workspace - #8971
Merged
Conversation
…se… [ORB-23827] [code-review] Code-review cleanup: vacuous and host-dependent assertions in crates/orbit-cli/tests/workspace Fixes: 85118e8 ("Allow replica-local scheduled worktree GC with honest routine control capabilities (#3320)") Regression-From: ORB-14173 Regression: defect_in_new; escape=no_test; severity=low Fixes: 0edd136 ("fix: Make doctor's clock-unit check verify the sweep timer is enabled a… [ORB-16351] (#4923)") Regression-From: ORB-16351 Regression: broke_existing; escape=no_test; severity=low Fixes: 9a3e046 ("feat: Worktree GC routine prunes the workspace .orbit/tmp scratch direc… [ORB-14432] (#3521)") Regression-From: ORB-14432 Regression: broke_existing; escape=no_test; severity=low Fixes: c2e94f9 ("fix: [qa-sweep] Installing a new binary SIGTERMs live drains and record… [ORB-13013] (#2618)") Regression-From: ORB-13013 Regression: defect_in_new; escape=nondeterministic; severity=low Fixes: 8023d01 ("feat: Host registry: `orbit host add|list|show|remove` over a CLI-owned… [ORB-14448] (#3556)") Regression-From: ORB-14448 Regression: defect_in_new; escape=no_test; severity=nit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
ORB-23827 — [code-review] Code-review cleanup: vacuous and host-dependent assertions in crates/orbit-cli/tests/workspace
Description
Grouped low/nit findings from the code-review sweep of module
dir:crates/orbit-cli/tests/workspace(22,275 lines, 40 files) atagent-main@ad6324277cd9a7d607bd7c09b0f1a1941d553c81. Every finding was re-verified against the pinned tree. All are test-suite defects (no product behavior is wrong); each lets a real regression pass unnoticed or makes a test depend on ambient host state.Findings
crates/orbit-cli/tests/workspace/replica_routines.rs:508-513(exercise_routine_settlement). The check readsfired["auto_task_reports"], butorbit sweep --format jsonhas no such key:crates/orbit-cli/src/command/clock/tick.rs:220-284merges auto-task rows intoreportswithkind: "auto_task"and exposes a top-levelminted.is_none_or(..)is therefore always true, and theenable_auto_taskedit at 893-902 is never asserted to have taken effect. Fix: assert on the real shape (noreportsrow of kindauto_taskevaluated/minted,mintedempty) and assert the seed edit applied. Culprit: ORB-14173 (85118e8, PR Allow replica-local scheduled worktree GC with honest routine control capabilities #3320; the shape was alreadyreportsat that commit) — defect_in_new / no_test.crates/orbit-cli/tests/workspace/sweep_root.rs:141-182(doctor_flags_an_installed_clock_without_deadline_or_descendant_cleanup). It asserts only statuswarningplus the remediation string. Since ORB-16351 (0edd136)clock_unit_row/apply_clock_manager_readiness(crates/orbit-cmd/src/doctor/report.rs:611-675) fold in the livesystemctl --usertimer state (crates/orbit-clock/src/status/query.rs:12-58), and the fixturecommand(sweep_root.rs:219-243) overrides only HOME/USERPROFILE. On a host with no enabled+activeorbit-sweep.timerboth assertions hold whatever the unit file contains, and the outcome depends on ambient host state. Fix: isolate the manager query in the fixture (e.g. a stubsystemctlon PATH reporting a healthy timer) and assert on the deadline/cleanup-specific detail. Culprit: ORB-16351 — broke_existing / no_test (test written by ORB-14592).scratch_older_than_hours—crates/orbit-cli/tests/workspace/worktree_gc_routing.rs:560-606(zero_worktree_gc_age_floor,replace_seeded_older_than_hours_default) andcrates/orbit-cli/tests/workspace/replica_routines.rs:906-923(zero_worktree_gc_age_floor). The substring match onolder_than_hours:also rewritesscratch_older_than_hours: 24(crates/orbit-core/assets/jobs/worktree_gc_pipeline.yaml:21), contrary to the helper's doc, so fixture sweeps prune.orbit/tmpwith a 0-hour floor (crates/orbit-engine/src/executor/automation/mod.rs:126-131). Same area: the comment at worktree_gc_routing.rs:241-243 says the seed defaults to a 24h floor (asset line 16 says 1), andenable_worktree_gc_routine(608-616) replacesenabled: falsealthough the asset shipsenabled: true(a no-op) and never asserts its cron replace applied. Fix: match the key at line start/exact key, assert each replace changed the text, correct the comment. Culprit: ORB-14432 (9a3e046 added the scratch key after the helpers existed) — broke_existing / no_test.RUST_LOG—crates/orbit-cli/tests/workspace/generation_root.rs:412-422(orbitfixture) does not neutraliseRUST_LOG(not inINHERITED_AUTHORITY_ENV,crates/orbit-common/src/test_env/env.rs), whileclock_ticks_during_generation_hold_emit_one_dated_summary_on_resumeassertsrefused.stderr.is_empty()(313-316) and exactly one stderr line (324-325). A developer shell withRUST_LOG=debugfails it. Sibling fixtures setRUST_LOG=offor remove it (deployment_gc.rs:52,doctor_confirm.rs:45, theinit_*fixtures). Same gap inhost_fleet.rs:144-159(Fleet::process). Fix: neutraliseRUST_LOGin both fixtures. Culprit: ORB-13013 (c2e94f9 added the assertions) — defect_in_new / nondeterministic.Options —crates/orbit-cli/tests/workspace/host_registry.rs:133-137(host_add_reads_identity_from_the_remote_and_refusals_leave_the_file_untouched):written.find(a) < written.find(b)passes when the first needle is absent (None < Some(_)). Fix: require both positions to beSomebefore comparing. Culprit: ORB-14448 (8023d01) — defect_in_new / no_test.crates/orbit-cli/tests/workspace/workspace_source_remote.rs:575-602(source_remote_help_names_inspection_dry_run_and_rebind) pins help wording viacontains()("roll back", "publication bindings", "Credentials", "first source identity"), which the repo guide's test rules disallow (text-matching / wording pins; help text is covered by goldens). Fix: retire the wording asserts or reduce to structural checks (flags exist), naming the surviving golden coverage. Written by ORB-11426 (451c5f8, 2026-09-06). Unattributed: the evidence does not show the no-wording-pin rule predates that commit, so noregression_fromlink is recorded for it.Scope
Test-only changes inside
crates/orbit-cli/tests/workspace. No product code change is expected. Each corrected assertion must be shown to fail when the guarded behavior is broken (e.g. temporarily perturb the fixture) and pass on the current tree.Acceptance Criteria
orbit sweep --format jsonactually emits (reportsrows of kindauto_task,minted), and asserts theenable_auto_taskseed edit applied.systemctl --usertimer state and fails if the unit's missing deadline/descendant-cleanup stops being reported.older_than_hours, leavescratch_older_than_hoursuntouched, assert their replacements applied, and the stale 24h comment and the no-openabledreplace are corrected.RUST_LOG, so the stderr assertions pass withRUST_LOG=debugexported.contains()pins in workspace_source_remote.rs are retired or reduced to structural checks, with surviving coverage named in the execution summary.cargo nextest run -p orbit-cli --test workspace(or the equivalentcargo test -p orbit-cli --test workspace) for the touched test modules.Execution Summary
Click to expand
Outcome: test-only repair of six vacuous or host-dependent assertions under crates/orbit-cli/tests/workspace. No product code changed. Perturbations used to show each new assertion fail were restored before handoff; the diff is only the seven test files.
Changes:
Criteria:
Validation:
Reconciliation: baseline HEAD c233d75 was clean. git status --short is the seven modified test files, all inside the existing selectors' directory. git diff --check is clean. No untracked deliverable paths. context_files were not edited. Scratch and perturbation copies stay under .orbit/tmp (gitignored). No leftovers outside that directory.
Deviations: age-floor helpers stay duplicated in the two test files rather than a new shared module. sweep_workspace.rs already rewrote the YAML key exactly and was left unchanged. Doctor assertions still match the deadline phrases in CLI JSON because the criterion requires that detail; that is separate from the retired help-prose pins. host_fleet RUST_LOG=off also covers host_dashboard and host_routing, which share Fleet::process.
Validation
Branch Freshness
origin/agent-mainorbit/ORB-23827-7033c354