Description
Object lifecycle is managed via ObjectLifecycleService, but there's no verification that resources are properly cleaned up between tests — no leak detection for unclosed connections, unregistered event handlers, or open file handles.
Proposed Approach
- Create
IResourceLeakDetector monitoring unmanaged handle counts, open file handles, active subscriptions
- Implement
ResourceSnapshot before/after each test
- Add
--detect-leaks command-line option
- Create
[RequireCleanup] attribute for verification
- Generate resource leak reports
Description
Object lifecycle is managed via
ObjectLifecycleService, but there's no verification that resources are properly cleaned up between tests — no leak detection for unclosed connections, unregistered event handlers, or open file handles.Proposed Approach
IResourceLeakDetectormonitoring unmanaged handle counts, open file handles, active subscriptionsResourceSnapshotbefore/after each test--detect-leakscommand-line option[RequireCleanup]attribute for verification