test(conftest): UP-57 - compat-check cleanup, thread_registry, stale DB sweep#56
Merged
Killea merged 1 commit intoKillea:mainfrom Mar 8, 2026
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Test plan
Notes
PRs #50-55 on upstream are all MERGEABLE and have no impact on test infrastructure.