Repository navigation
Keep runtime test mocks from breaking asynchronous logging - #88
Conversation
Code Review ✅ Approved🟢 Low risk · Test fixtures isolate thread mocks and exercise queued logging without changing runtime code. Isolates runtime test mocks for scheduler heartbeat and search-indexer shutdown to prevent asynchronous logging from breaking. Scoped fakes to each service module's OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
PR reader API performanceResult: INCONCLUSIVE 6 inconclusive · 2 within threshold. Zero request failures across all six runs. Base Three independent runs per revision, each on a fresh GitHub-hosted ARM64 runner. 16 users, 60 seconds/run, 1,000 synthetic articles, cache off, five PgBouncer slots. Latency comparisonAll latency values are in milliseconds; lower is better. Values are medians of three runs.
Additional latency and throughput metricsEach cell shows base → PR. Latencies are in milliseconds.
Individual runs
How to interpret this reportRegressed / Improved: a p95 regression needs >20% and >20 ms increase in the medians and at least two head samples versus the base median. Improvements use the inverse threshold. Within threshold means the change did not meet both thresholds. Inconclusive: a within-revision p95 range >35% of its median and >20 ms is too noisy for a confident latency verdict. Inconclusive latency comparisons are non-blocking: the check passes without claiming an improvement. Confirmed regressions and test/report errors fail the PR gate. Throughput is descriptive: paced users do not measure maximum capacity. This uncached public API test does not establish production health, browser performance or worker capacity. Separate runners can differ in hardware or host load; repetitions and noise checks reduce but cannot eliminate that uncertainty. Full HTML/CSV reports and logs · attempt 1 |
Backend unit coveragePASS · minimum combined coverage 67.60%. Tests: 3007 passed, 0 failed, 0 skipped. Source files: 273.
Unit coverage includes every backend workspace. PostgreSQL/Redis integration tests run separately. Commit: 691a038 · HTML, JSON, XML reports and job logs · attempt 1 |
|



What changes and why?
Scheduler heartbeat and search-indexer shutdown fixtures replaced
threading.Eventon Python’s shared module. During backend tests, an asynchronous API log writer could then callisinstance(..., threading.Event)with a function instead of a class, lose its output thread and emit an unhandled-thread warning. This occurred in the #79 unit job.Scope each fake to its service module’s
threadingbinding. The heartbeat, wait, signal and cleanup assertions remain intact. A shared regression fixture now sends and drains a real queued log during every scheduler/indexer runtime case, and verifies that the writer remains alive.Related issues
Related to #79. This unrelated fixture repair is isolated from that production refactor. Merge after #79 and before continuing #80–#84, one PR at a time.
Validation
-W error::pytest.PytestUnhandledThreadExceptionWarning.CI required, all three CodeQL analyses, Sonar, dependency/secret/workflow checks, populated upgrades, real API/admin journeys, web/Chrome/Edge reader parity, performance comparison and ARM64 image checks.Rollout notes
No application, dependency, database, workflow or deployment change. Auto-merge is disabled. Wait for current-head
CI required, CodeQL and Sonar to pass and resolve all review threads before manually merging.Ready for review