Skip to content

test(conftest): UP-57 - compat-check cleanup, thread_registry, stale DB sweep#56

Merged
Killea merged 1 commit intoKillea:mainfrom
bertheto:fix/UP-57-test-cleanup
Mar 8, 2026
Merged

test(conftest): UP-57 - compat-check cleanup, thread_registry, stale DB sweep#56
Killea merged 1 commit intoKillea:mainfrom
bertheto:fix/UP-57-test-cleanup

Conversation

@bertheto
Copy link
Contributor

@bertheto bertheto commented Mar 8, 2026

Summary

  • Problem 2a - compat-check thread leaked: The compatibility probe in conftest.py created a temp thread + agent + message on every test run but never deleted them. Now deletes the thread immediately after the probe.

  • Problem 2b - Integration tests leave orphaned threads: When reusing an external server, threads created by tests accumulate indefinitely. Added an optional thread_registry session fixture: tests can opt in via thread_registry.register(tid) for explicit teardown. Zero changes to existing test files.

  • Problem 2c - Test DB file proliferation: tests/data/ accumulated 11+ DB files across runs. Extended the server fixture's finally teardown to glob-remove all tests/data/.db files (excluding bus_test.db), guarded by if started_here to avoid touching files owned by an external server.

Files changed

  • tests/conftest.py - 58 lines added, no deletions

Test plan

  • 37 unit tests pass
  • 13 e2e tests pass with full server fixture lifecycle
  • thread_registry fixture is discoverable via pytest --fixtures
  • No linter errors

Notes

PRs #50-55 on upstream are all MERGEABLE and have no impact on test infrastructure.

…DB sweep

- Delete __compat_check__ thread after compatibility probe to avoid
  polluting shared server DB with orphaned test data (Problem 2a).

- Add optional 	hread_registry session fixture: tests can opt in via
  	hread_registry.register(tid) for explicit teardown against an
  external server. Non-invasive — no changes to existing test files
  (Problem 2b).

- Extended server fixture teardown to glob-delete all 	ests/data/*.db*
  files (excluding bus_test.db which is already handled) when conftest
  started the server (started_here guard). Prevents DB file
  accumulation across runs (Problem 2c).

Fixes: UP-57
@Killea Killea merged commit d885ef5 into Killea:main Mar 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants