Repository navigation
fix(test) Add scope guard for logger sink cleanup in index tests - #488
Merged
Merged
Conversation
rfsaliev
requested review from
ahuber21,
mihaic and
yuejiaointel
as code owners
November 25, 2026 13:57
ethanglaser
approved these changes
Nov 25, 2026
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.
This pull request improves the reliability of logging tests across several index-related test files by ensuring that custom logging sinks are properly removed after each test case. This is achieved by introducing a scope guard to automatically clean up the logging sinks, preventing potential issues with dangling pointers or memory leaks. Additionally, necessary includes for
<algorithm>and the newsvs/lib/scopeguard.hutility are added to support these changes.Test reliability and logging cleanup:
svs::lib::make_scope_guard) in all logging-related test cases to ensure that the custom logging sink (global_callback_sink) is removed from the logger's sink list when the test scope ends, preventing resource leaks and potential test interference. [1] [2] [3] [4] [5] [6]Dependency and include updates:
svs/lib/scopeguard.hand<algorithm>where necessary to support the new scope guard functionality and the use ofstd::removefor sink removal. [1] [2] F51d32a0L17R17, [3] [4] [5] [6] F51d32a0L17R17, [7]These changes collectively make the logging tests more robust and maintainable by ensuring proper cleanup and preventing side effects between tests.