test: assert Logger output for backpressure and thread-pool worker exceptions#471
Merged
Conversation
✅ Dependency Audit
See the Security tab for detailed findings. Workflow: Dependency Audit |
Security Scan Results
Recommendations
Workflow: Security Scanning |
…ceptions Add spdlog ringbuffer_sink_mt-based assertions to test_agent_core.cpp (AgentCoreLogTest) and test_thread_pool.cpp (ThreadPoolLogTest) so that backpressure inbox-full / recovered log lines and worker exception log lines are verified at the correct content level, not just "no crash". Closes #337 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
AgentCoreLogTestsuite totest_agent_core.cppwith two new tests:BackpressureInboxFullLogsWarn— verifies[BACKPRESSURE] ... inbox fullis logged at warn level whenAgentCorereceives messages beyondAGENT_MAX_QUEUE_SIZEBackpressureRecoveryLogsInfo— verifies... recovered ... accepting messagesis logged at info level once the queue drains below the low watermarkThreadPoolLogTestsuite totest_thread_pool.cppwith two new tests:WorkerStdExceptionIsLogged— verifiesThreadPool: Exception in worker: <msg>is logged at error when a task throwsstd::exceptionWorkerUnknownExceptionIsLogged— verifiesThreadPool: Unknown exception in workeris logged at error for non-std::exceptionthrowsspdlog::sinks::ringbuffer_sink_mtinjected viaspdlog::get("keystone")->sinks()so assertions run against real spdlog output without requiring stderr capture or mocking.Closes #337
Test plan
cmake --preset debug && cmake --build --preset debug && ctest --preset debug -R "AgentCoreLog|ThreadPoolLog" --output-on-failurecmake --preset asan && cmake --build --preset asan && ctest --preset asan -R "AgentCoreLog|ThreadPoolLog" --output-on-failurejust format-checkpasses (verified locally)🤖 Generated with Claude Code