fix-project-leak-from-tc-report
Installation
SKILL.md
Fix a _LastInSuiteTest.testProjectLeak from a TeamCity report
This is the full fix workflow. Investigation-only tasks (identify + reproduce + analyze) are covered by the sibling leaking-test-investigation-by-tc-report skill; the two overlap in phases 1–3 but this one adds phases 4–5 (apply fix, verify).
The workflow is:
- Identify the culprit test from the TC report.
- Reproduce the leak locally 10 times, archiving every heap dump + stdout.
- Analyze all unique retention chains observed (local ± CI-reported).
- Fix each retention chain independently with a pattern from the catalogue below.
- Verify by rerunning the leak-hunter loop on the patched tree and confirming it stops firing.
The bundled scripts are self-contained — do not source the other skill's copies.
Phase 1 — identify the culprit test
The leaked Project name is the strongest signal. In ProjectRule() / heavy-project rules the project name defaults to the test class simple name. So: