Stop the os-backlog route test from swapping $stdin under parallel tests #1632

Closed
opened 2026-11-07 18:59:04 +00:00 by jared · 2 comments
Owner

Problem

ResolveCliTest#test_resolve_prints_use_with_the_configured_tracker fails on some seeds and passes on others. The test swaps the global $stdin, and the os-backlog suite runs tests in parallel with parallelize_me!. CliTicketProjectLabelGroupsTest also swaps $stdin (its with_stdin helper). When the two tests overlap, project route reads the wrong input.

project route is the only command that reads $stdin. It has no caller outside its own tests: no skill, hook, script, or other repo calls it. It started in #12 (commit 8d4b1c7f, 2026-07-10) as a pure Planka board resolver that took its inputs on stdin. ADR-0042 retired Planka. Today the command ignores repo_path and only echoes the tracker= line of config text that the caller sends. project show already reads the real .cc-os/config and prints the tracker.

Observed

On main 14fd26ed and ba5f46c6, ruby plugins/os-backlog/tests/all.rb --seed 3225 fails this test on some runs. --seed 19992 passes.

Approach

Delete the dead command and its chain, so no code reads $stdin outside the SessionStart hook (which already injects it):

  • ProjectGroup#route and ProjectCommands#resolve
  • Project.from_config, Project#route, Project::Route
  • tests/resolve_cli_test.rb, tests/project_route_test.rb
  • "project route" in the CliTicketProjectLabelGroupsTest name list, and its with_stdin helper
  • regenerate the design files

Rejected: inject an IO through CLI::Wiring (keeps a command with no use); mark the test class serial (hides the global swap).

Acceptance criteria

  1. Given the os-backlog CLI, when os-backlog project route runs, then Thor reports Could not find command.
  2. Given the os-backlog tests, when they are searched, then no test assigns $stdin.
  3. Given the os-backlog suite, when it runs 20 times with random seeds, then it has 0 failures.

Origin

  • Trigger: random-seed suite run during the A6 fix on #1624 (implementation 261)
  • Revised 2026-11-07 by Jared's ruling: delete the command instead of injecting stdin
  • Where: plugins/os-backlog/lib/backlog/cli/project_commands.rb, plugins/os-backlog/tests/resolve_cli_test.rb
## Problem `ResolveCliTest#test_resolve_prints_use_with_the_configured_tracker` fails on some seeds and passes on others. The test swaps the global `$stdin`, and the os-backlog suite runs tests in parallel with `parallelize_me!`. `CliTicketProjectLabelGroupsTest` also swaps `$stdin` (its `with_stdin` helper). When the two tests overlap, `project route` reads the wrong input. `project route` is the only command that reads `$stdin`. It has no caller outside its own tests: no skill, hook, script, or other repo calls it. It started in #12 (commit 8d4b1c7f, 2026-07-10) as a pure Planka board resolver that took its inputs on stdin. ADR-0042 retired Planka. Today the command ignores `repo_path` and only echoes the `tracker=` line of config text that the caller sends. `project show` already reads the real `.cc-os/config` and prints the tracker. ## Observed On main 14fd26ed and ba5f46c6, `ruby plugins/os-backlog/tests/all.rb --seed 3225` fails this test on some runs. `--seed 19992` passes. ## Approach Delete the dead command and its chain, so no code reads `$stdin` outside the SessionStart hook (which already injects it): - `ProjectGroup#route` and `ProjectCommands#resolve` - `Project.from_config`, `Project#route`, `Project::Route` - `tests/resolve_cli_test.rb`, `tests/project_route_test.rb` - `"project route"` in the `CliTicketProjectLabelGroupsTest` name list, and its `with_stdin` helper - regenerate the design files Rejected: inject an IO through `CLI::Wiring` (keeps a command with no use); mark the test class serial (hides the global swap). ## Acceptance criteria 1. Given the os-backlog CLI, when `os-backlog project route` runs, then Thor reports `Could not find command`. 2. Given the os-backlog tests, when they are searched, then no test assigns `$stdin`. 3. Given the os-backlog suite, when it runs 20 times with random seeds, then it has 0 failures. ## Origin - Trigger: random-seed suite run during the A6 fix on #1624 (implementation 261) - Revised 2026-11-07 by Jared's ruling: delete the command instead of injecting stdin - Where: plugins/os-backlog/lib/backlog/cli/project_commands.rb, plugins/os-backlog/tests/resolve_cli_test.rb
Author
Owner

Start: deleting the dead project route chain on main (Jared ruling 2026-11-07).

Start: deleting the dead project route chain on main (Jared ruling 2026-11-07).
Author
Owner

Resolution

Done: Deleted the dead project route command chain and its stdin-swapping tests (ac06a3d1)

Evidence: os-backlog suite 20 runs: 527 runs, 0 failures each; grep finds no $stdin assignment in tests; 'os-backlog project route' gives Could not find command "route"; rubocop 0 offenses on changed files

Follow-ups: none

## Resolution **Done:** Deleted the dead project route command chain and its stdin-swapping tests (ac06a3d1) **Evidence:** os-backlog suite 20 runs: 527 runs, 0 failures each; grep finds no $stdin assignment in tests; 'os-backlog project route' gives Could not find command "route"; rubocop 0 offenses on changed files **Follow-ups:** none
jared closed this issue 2026-11-07 19:21:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1632
No description provided.