Repository navigation
test(processtree): cover reparenting strategy selection and fallbacks - #1045
Conversation
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
matthyx
left a comment
There was a problem hiding this comment.
No blocking findings. The new tests cover existing strategy ordering, short-circuiting, parent eligibility, fallback behavior, and returned-slice isolation. The base still gives DefaultStrategy and FallBackStrategy the same name; correcting DefaultStrategy to default is sound and does not change PID selection. Related #591/#604 history provides no objection to this correction; #1027 and #876 address different process-tree paths and do not supersede this coverage.
Validated go test -mod=readonly -race -count=3 ./pkg/processtree/reparenting/... with Go 1.27.0 in an isolated container: both packages passed. Formatting and diff checks also pass. No full-agent build/full-suite run; a separate baseline assertion run did not finish, so no completed before/after result is claimed. Listed CI contains successful DCO, GitGuardian, and CodeRabbit checks, with no build/unit-test result.
Reviewed head c0d1ab7 against main c7a77c1. Immediately rechecked: still open, non-draft, mergeable, unchanged head/base, and no review threads. Independent code and architecture reviews found no blockers.
|
Thanks for the quick review! |
Overview
pkg/processtree/reparentinghad no tests forDefaultStrategy,FallBackStrategy, or the logic that picks between strategies. This PR adds them, plus a one-line fix.New tests:
DefaultStrategy: exiting process missing, PPID 0, parent missing, parent tracked.FallBackStrategy: always applicable, always returns 1.AddStrategyandGetStrategies.Fix:
DefaultStrategy.Name()returned"fallback", the same asFallBackStrategy. It was"default"in the early #591 work and changed when the strategies were split into separate files. Nothing callsName()today. Happy to drop this commit if the shared name is intentional.Coverage of
./pkg/processtree/reparenting/...goes from 20.0% to 90.8% (Go 1.27.3).How to Test
Summary by CodeRabbit