test(logging): drain mixed-mode probe logger - #99
Merged
Conversation
Make the per_logger_mixed_mode_test probe logger call shutdown from its destructor so tasks submitted to the global TaskExecutor cannot run after the stack logger is destroyed. This mirrors the built-in async logger lifecycle and fixes the macOS post-main crash where the test printed all PASS lines but CTest still observed a failed process exit.
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
per_logger_mixed_mode_testprobe logger teardown so global-executor tasks cannot outlive the stack logger they capture.shutdown()from the destructor.Cause
The failed macOS main run printed
PASS: mixed_mode_drain,PASS: mixed_mode_shutdown, and2 passed, 0 failed, but CTest still marked the process failed.LastTest.logpoints to a post-output process failure:CountingLoggeronly shut down its dedicated executor in the destructor, while global-executor tasks capturedthisand could run after the stack object was destroyed.Tests
cmake --build build-codex-fix --target per_logger_mixed_mode_testctest --test-dir build-codex-fix -R per_logger_mixed_mode_test --output-on-failure --repeat until-fail:100cmake --build build-codex-fix --target per_logger_isolation_testctest --test-dir build-codex-fix -R "per_logger_isolation_test|per_logger_mixed_mode_test" --output-on-failure --repeat until-fail:50