Skip to content

Tests: Inventory.norm applies TREE_ID before it takes out the sandbox root, so two test_lanes_index tests fail when the run root path holds a segment like c302-309-work #334

Closed

Description

@brettheap

This comes from lane 3's review of lane 4's #302 phase-2 code (#302 comment 6371844475, its test runs). It is filed on Brett Heap's approval, "yes, file the issues", given in lane 3's session at about 20:13Z on 2026-10-23.

It is a test-harness bug, not a product bug. Two tests in tests/test_lanes_index.py pass or fail depending on the name of the folder the suite runs from.

What is wrong (at 33ce26d)

  • The order in Inventory.norm (tests/test_lanes_index.py:1764–1772):
    1. It applies TREE_ID (:1679, \bc[0-9]+-[A-Za-z0-9._-]+) to the whole answer (:1769).
    2. Only after that does it replace the sandbox root's resolved path (:1770) and call normal with the root (:1772).
  • What goes wrong. When the root's own path holds a segment that TREE_ID matches, TREE_ID rewrites that segment first. For example, c302-309-work in a run under …/rv-c302-309-work/… becomes rv-<TREE>. The root replacement and normal then find no root to take out, and the comparison fails.
  • The two tests that fail this way:
    • test_offline_no_read_the_inventory_acts_are_byte_identical_against_an_unreachable_index;
    • test_a_poisoned_worktrees_table_changes_no_inventory_acts_answer.
  • Evidence. The reviewer ran both tests by direct calls. They failed identically at 3e97ae5, e7f86b6 and da0ffa2. With the root replaced first, they passed at all three.
  • Why it matters. tests/run.sh builds its run root under the caller's XDG state directory, so the segment comes from wherever the caller's HOME or state directory is. Lane 3's reviewer folders are named rv-c<digits>-…, so such runs report two failures that have nothing to do with the change under review.

Direction

  • Swap the order in norm: take out the sandbox root, as given and as resolved, before TREE_ID and the pid rule run.
  • Add one test that runs norm with a root whose path holds a c<digits>-… segment, and fails on today's order.
  • Scope. It is a test-only change, and no product code changes.
  • Order. v1.2.0, after the v1.1.0 tag. It touches tests/test_lanes_index.py, so check the open branches for conflicts when it is written.

Not started: v1.2.0 work waits for the v1.1.0 tag and Brett's word.

Activity

  1. added this to the v1.2.0 milestone on Oct 23, 2026
  2. brettheap commented on Oct 24, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoTools-3, session 83619980-06bb-4469-ae73-2a8c5e61981a@Eagle, 2026-10-24T16:36:36Z, for #334

    Logged in lanes/log/openRepoTools-3.md at 68d1043498bc1dc3d7565d10387c308ddfb2e2aa.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#334:
       none
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#334"`, kept where the row or its body names `#334`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `334` as a whole token:
       none
    
  3. brettheap commented on Oct 25, 2026

    @brettheap
    ContributorAuthor

    Lane openRepoTools-3, 2026-10-25T15:33Z: the fix for #334 is on branch fix/334-norm-replaces-root-first at 77ff7bfc6db9f705a98f13285cf63cb235422148, one commit on main 33ce26d. It opens no pull request until v1.1.0 is tagged, and it needs an independent review before it lands.

    • The change, in tests/test_lanes_index.py only (+72/−3): Inventory.norm now takes the sandbox root out, both as given and as resolved, before it applies TREE_ID and the pid rule. lanes-edit.sh and the golden files are unchanged.
    • The new test builds the same answer text under four roots and requires one golden text: a plain root, a c<digits>- segment, that segment only in the resolved path, and the pid as a segment. It runs without a sandbox.
    • RED on main's norm: 3 of the 4 roots fail. The issue's two real tests fail under a root holding rv-c302-309-work and pass under a plain one.
    • GREEN: all four roots pass, and so do both real tests under both roots. Three wrong fixes were swapped in, and each is caught by the root expected to catch it.
    • The one tests/run.sh, -k "test_lanes_index or test_repo_hygiene": 339 passed and 2674 deselected, in 5 min 48 s.
    • Overlap: the other open branches' hunks in this file are far from this one's, at about lines 205–220, 2403–2442 and 2942. The fix's are at about 1764–1850. No merge was tried.

    Lane: openRepoTools-3

  4. modified the milestones: v1.2.0, v1.2.1 on Nov 8, 2026
  5. brettheap commented on Nov 10, 2026

    @brettheap
    ContributorAuthor

    RELEASED — lane openRepoTools-3, session 83619980-06bb-4469-ae73-2a8c5e61981a@Eagle, 2026-11-10T12:46:13Z, for #334 — closed by opensoft/openRepoTools-code#24 (squash b4b6b15)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions