Find why DetectorEntryPointsTest#test_bin_script_maps_to_its_first_constant takes 11.8 s #1338
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1338
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
DetectorEntryPointsTest#test_bin_script_maps_to_its_first_constant(plugins/os-sdlc/tests/detector/entry_points_test.rb:12) takes 11.8 s. It starts no subprocess. It appears to load and parse the whole codebase. The os-sdlc suite runs 65.8 s against a 60 s budget.Approach
Investigate first. Find which step takes the time (file discovery, parse, or constant resolution) and why the test needs the whole codebase. Then make the test fast without losing what it proves: a bin script maps to its first constant. A small fixture tree is one option. A narrower input to the entry-point mapper is another.
Required work:
Acceptance criteria
Owner sketch
The entry-point mapper tested in
plugins/os-sdlc/tests/detector/entry_points_test.rb.Non-goals
The conversion of the detector bin tests to in-process calls. Another ticket covers it (#1330).
Origin
ruby plugins/os-sdlc/tests/all.rbtook 65.8 s against a 60 s budget. About 70% of summed test time is tests that start our own bin scripts with Open3.Resolution
Done: Investigated; the 11.8 s no longer reproduces. DetectorEntryPointsTest#test_bin_script (plugins/os-sdlc/tests/detector/entry_points_test.rb:12) takes 0.15-0.33 s alone and 0.62 s in the full suite. No code change.
Evidence: 2026-10-27 measurements: full suite 51.9 s for 2728 runs (ticket recorded 65.8 s). EntryPoints#entries (lib/os_sdlc/detector/entry_points.rb:26-36) calls Prism.parse_file 44 times (42 bin scripts + boot/commands.rb), 0.118 s cold, 0.04 s warm; no subprocess, no RuboCop, no whole-repo parse. The old outlier was most likely load from the Open3 bin tests that #1337/f4cfb8fb moved in-process.
Follow-ups: none: optional class-level memo of entries saves about 0.1 s and is dropped; a slowest-tests report ticket is dropped as speculative.