Why: the port governance was whack-a-mole because earlier passes only scanned tests/test_svc.py. Scanning the whole tree found five more files whose seed_agent calls bind hardcoded ports, and the clearest proof they are a real hazard is that ports 9461 and 9462 each appear in three different files at once — test_svc_lifecycle_isolation.py, test_svc_rdm_admin.py and test_svc_u2.py all use both. Any parallel or leftover-process scenario makes those files collide.
Evidence:
seed_agent (defined in tests/test_svc_recover.py:269) starts the stub binary, which listens on the port it is given, so these literals are genuine flaky sources rather than cosmetic ones.
Verified by occupation: with 9461 and 9462 each held by an unrelated python3 -m http.server, all five files still pass (125 tests). Before the change the rdm_admin, u2 and lifecycle_isolation files would have fought over the same two ports.
Each file imports free_test_port from the shared tests/_port_alloc.py, using the same sys.path preamble already present in tests/test_svc.py. No new helper was introduced.
Where a test seeds the same instance more than once, the original single-port semantics are preserved by reusing one variable rather than allocating twice.
tests.test_svc_recover, which defines seed_agent, is untouched, as is tests/test_svc.py. No assertion was removed, skipped or relaxed, and no test logic changed beyond the port source.
The broader svc suite is green: 173 tests across the nine affected and adjacent modules, 2 skipped.
This batch covers test_svc_identity.py (16 sites), test_svc_rdm_admin.py (12), test_svc_u2.py (7), test_svc_user_binding.py (5) and test_svc_lifecycle_isolation.py (2). One file remains — test_svc_deploy_txn.py, which does not inherit seed_agent and needs its own fixture wiring; it is deliberately left out of this batch rather than half-changed.
Refs: continues the governance that introduced tests/_port_alloc.py and the two earlier batches.
Why: the port governance was whack-a-mole because earlier passes only scanned `tests/test_svc.py`. Scanning the whole tree found five more files whose `seed_agent` calls bind hardcoded ports, and the clearest proof they are a real hazard is that ports 9461 and 9462 each appear in three different files at once — `test_svc_lifecycle_isolation.py`, `test_svc_rdm_admin.py` and `test_svc_u2.py` all use both. Any parallel or leftover-process scenario makes those files collide.
Evidence:
- `seed_agent` (defined in `tests/test_svc_recover.py:269`) starts the stub binary, which listens on the port it is given, so these literals are genuine flaky sources rather than cosmetic ones.
- Verified by occupation: with 9461 and 9462 each held by an unrelated `python3 -m http.server`, all five files still pass (125 tests). Before the change the rdm_admin, u2 and lifecycle_isolation files would have fought over the same two ports.
- Each file imports `free_test_port` from the shared `tests/_port_alloc.py`, using the same sys.path preamble already present in `tests/test_svc.py`. No new helper was introduced.
- Where a test seeds the same instance more than once, the original single-port semantics are preserved by reusing one variable rather than allocating twice.
- `tests.test_svc_recover`, which defines `seed_agent`, is untouched, as is `tests/test_svc.py`. No assertion was removed, skipped or relaxed, and no test logic changed beyond the port source.
- The broader svc suite is green: 173 tests across the nine affected and adjacent modules, 2 skipped.
This batch covers `test_svc_identity.py` (16 sites), `test_svc_rdm_admin.py` (12), `test_svc_u2.py` (7), `test_svc_user_binding.py` (5) and `test_svc_lifecycle_isolation.py` (2). One file remains — `test_svc_deploy_txn.py`, which does not inherit `seed_agent` and needs its own fixture wiring; it is deliberately left out of this batch rather than half-changed.
Refs: continues the governance that introduced `tests/_port_alloc.py` and the two earlier batches.
Why: establish the authorized task workspace and its initial baseline.
Evidence: preserved precheck receipt in .task/fix-svc-test-port-governance-batch1.md; R0=3d3474a731f9ef3ee1f41935e63bca3afb70db56.
Impact: task metadata only; the feature workspace starts at 3d3474a731.
Refs: .task/fix-svc-test-port-governance-batch1.md
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=c92443280ef8e9ed29bf5bf5250df650c01b4478.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why: the port governance was whack-a-mole because earlier passes only scanned
tests/test_svc.py. Scanning the whole tree found five more files whoseseed_agentcalls bind hardcoded ports, and the clearest proof they are a real hazard is that ports 9461 and 9462 each appear in three different files at once —test_svc_lifecycle_isolation.py,test_svc_rdm_admin.pyandtest_svc_u2.pyall use both. Any parallel or leftover-process scenario makes those files collide.Evidence:
seed_agent(defined intests/test_svc_recover.py:269) starts the stub binary, which listens on the port it is given, so these literals are genuine flaky sources rather than cosmetic ones.python3 -m http.server, all five files still pass (125 tests). Before the change the rdm_admin, u2 and lifecycle_isolation files would have fought over the same two ports.free_test_portfrom the sharedtests/_port_alloc.py, using the same sys.path preamble already present intests/test_svc.py. No new helper was introduced.tests.test_svc_recover, which definesseed_agent, is untouched, as istests/test_svc.py. No assertion was removed, skipped or relaxed, and no test logic changed beyond the port source.This batch covers
test_svc_identity.py(16 sites),test_svc_rdm_admin.py(12),test_svc_u2.py(7),test_svc_user_binding.py(5) andtest_svc_lifecycle_isolation.py(2). One file remains —test_svc_deploy_txn.py, which does not inheritseed_agentand needs its own fixture wiring; it is deliberately left out of this batch rather than half-changed.Refs: continues the governance that introduced
tests/_port_alloc.pyand the two earlier batches.